From 288bfc521e11d1dd2a0873a716e6f8ca332ed6cd Mon Sep 17 00:00:00 2001 From: pgoslatara Date: Wed, 25 Sep 2024 11:41:02 +0200 Subject: [PATCH] Setting snapshot config for dbt Cloud --- dbt_project/snapshots/orders_snapshot.sql | 6 ++++-- dbt_project/target/manifest.json | 2 +- dbt_project/target/run_results.json | 2 +- tests/fixtures/dbt_16/target/catalog.json | 2 +- tests/fixtures/dbt_16/target/manifest.json | 2 +- tests/fixtures/dbt_16/target/run_results.json | 2 +- tests/fixtures/dbt_17/target/catalog.json | 2 +- tests/fixtures/dbt_17/target/manifest.json | 2 +- tests/fixtures/dbt_17/target/run_results.json | 2 +- tests/fixtures/dbt_18/target/catalog.json | 2 +- tests/fixtures/dbt_18/target/manifest.json | 2 +- tests/fixtures/dbt_18/target/run_results.json | 2 +- 12 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dbt_project/snapshots/orders_snapshot.sql b/dbt_project/snapshots/orders_snapshot.sql index 6bd3c5a..1c6a446 100644 --- a/dbt_project/snapshots/orders_snapshot.sql +++ b/dbt_project/snapshots/orders_snapshot.sql @@ -2,8 +2,10 @@ {{ config( - target_database="dbt", - target_schema="snapshots", + target_database=( + "dbt" if target.type == "duckdb" else "padraic-slattery-sndbx-o" + ), + target_schema="dbt_pslattery", unique_key="id", strategy="timestamp", updated_at="order_date", diff --git a/dbt_project/target/manifest.json b/dbt_project/target/manifest.json index a9d363c..0fbfc2f 100644 --- a/dbt_project/target/manifest.json +++ b/dbt_project/target/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.6", "generated_at": "2024-09-25T03:14:13.176627Z", "invocation_id": "9537c371-21f2-43c5-9766-659a1dda2cca", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1725351426.7680373, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1725351426.8455946, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1725351426.847957, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1725351426.8630025, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1725351426.8610454, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725351426.8860025, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/customers.sql", "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1725351426.9116123, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/orders.sql", "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1725351426.9160526, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_orders.csv", "unrendered_config": {}, "created_at": 1725351426.2518442, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_payments.csv", "unrendered_config": {}, "created_at": 1725351426.25373, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_customers.csv", "unrendered_config": {}, "created_at": 1725351426.2554023, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0351233, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.033452, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0296655, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0402725, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.03656, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1856692, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1792257, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1804655, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1812165, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1826887, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.177445, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1841698, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.4957714, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.522825, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5285096, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5341895, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5402792, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5827549, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5884075, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "unrendered_config": {}, "created_at": 1725351426.8182225, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "unrendered_config": {}, "created_at": 1725351426.8208003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1725351426.8222895, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.8489718, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.8507996, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.8523633, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.853709, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1725351426.8553824, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1725351426.8638334, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "unrendered_config": {}, "created_at": 1725351426.8758245, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "unrendered_config": {}, "created_at": 1725351426.879734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1725351426.881098, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "unrendered_config": {}, "created_at": 1725351426.886812, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "unrendered_config": {}, "created_at": 1725351426.8881884, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.9169123, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.918237, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "unrendered_config": {}, "created_at": 1725351426.9195504, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.920879, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.922205, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.9236255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "unrendered_config": {}, "created_at": 1725351426.9249752, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1725351426.9306407, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9339015, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "unrendered_config": {}, "created_at": 1725351426.93564, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9369721, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "unrendered_config": {}, "created_at": 1725351426.938284, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9396093, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.04117, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0427094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1725351427.0441225, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0513213, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0527382, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1725351427.0541415, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0584738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.059996, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1725351427.0613737, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0646627, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0660286, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1725351427.0673857, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0706155, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0719616, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true}, "created_at": 1725351427.073823, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1725351427.0761254, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.1866088, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1725351427.1881363, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.191603, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1725351427.1929796, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.1962543, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1725351427.1976264, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2008693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1725351427.202261, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2055838, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2069364, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1725351427.2083263, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2115595, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2129295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1725351427.2142768, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2178245, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2191455, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1725351427.2204921, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/tests/test_assert_something.sql", "unrendered_config": {}, "created_at": 1725351458.010832, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "snapshots", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "66c7297a2e7bafae8b9569abeee9f364001518a84ee37f26c722b00dcb9b3d3f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "snapshots", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/snapshots/orders_snapshot.sql", "unrendered_config": {"target_database": "dbt", "target_schema": "snapshots", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727234053.4127824, "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\"", "raw_code": "\n\n{{\n config(\n target_database='dbt',\n target_schema='snapshots',\n unique_key='id',\n\n strategy='timestamp',\n updated_at='order_date',\n )\n}}\n\nselect * from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1725351427.2258704}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1725351427.2270203}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1725351427.2271826}, "source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1725351427.2273881}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1725351427.2275693}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1725351427.2278574}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1725351427.2280595}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1725351427.2283907}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1725351427.2286203}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1725351427.228843}}, "macros": {"macro.dbt_bouncer_test_project.cents_to_dollars": {"name": "cents_to_dollars", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "macros/cents_to_dollars.sql", "original_file_path": "macros/cents_to_dollars.sql", "unique_id": "macro.dbt_bouncer_test_project.cents_to_dollars", "macro_sql": "{% macro cents_to_dollars(column_name) %} ({{ column_name }} / 100) {% endmacro %}", "depends_on": {"macros": []}, "description": "Macro to converts values in cents to dollars", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_macros.yml", "arguments": [{"name": "column_name", "type": null, "description": "A column that contains values in cents"}], "created_at": 1725351426.6519356, "supported_languages": null}, "macro.dbt_bouncer_test_project.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "macros/system/generate_schema_name.sql", "original_file_path": "macros/system/generate_schema_name.sql", "unique_id": "macro.dbt_bouncer_test_project.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n {#\n Enter this block when run on stg or prd (except for CICD runs).\n We want the same dataset and table names to be used across all environments.\n For example, `marts.dim_customer` should exist in stg and prd, i.e. there should be no references to the project in the dataset name.\n This will allow other tooling (BI, CICD scripts, etc.) to work across all environments without the need for differing logic per environment.\n #}\n {% if env_var(\"DBT_CICD_RUN\", \"false\") == \"true\" %} {{ env_var(\"DBT_DATASET\") }}\n\n {% elif target.name in [\"stg\", \"prd\"] and env_var(\n \"DBT_CICD_RUN\", \"false\"\n ) == \"false\" %}\n\n {{ node.config.schema }}\n\n {% else %} {{ default__generate_schema_name(custom_schema_name, node) }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "A macro that uses the DBT_DATASET env var only when using the dev target. On the stg and prd targets this env var is not used. This ensures that systems that read from the stg and prd BigQuery instances can use the same dataset and table names, they only need to vary the GCP project id.\n", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/system/_system__macros.yml", "arguments": [{"name": "custom_schema_name", "type": null, "description": "The variable dbt will pass to this macro"}, {"name": "node", "type": null, "description": "The various objects (models, tests, seeds, etc.)"}], "created_at": 1725351426.6557374, "supported_languages": null}, "macro.dbt_bouncer_test_project.test_values_below_threshold": {"name": "test_values_below_threshold", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "tests/generic/values_below_threshold.sql", "original_file_path": "tests/generic/values_below_threshold.sql", "unique_id": "macro.dbt_bouncer_test_project.test_values_below_threshold", "macro_sql": "{% test values_below_threshold(model, column_name, threshold) %}\n\n with\n validation as (\n\n select count(*) as above_threshold_cnt\n\n from {{ model }}\n where {{ column_name }} > {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1725351426.6535912, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n with relations AS (\n select\n t.table_name\n , t.database_name\n , t.schema_name\n , 'BASE TABLE' as table_type\n , {{ adapter.catalog_comment('t') }} as table_comment\n from duckdb_tables() t\n WHERE t.database_name = '{{ database }}'\n UNION ALL\n SELECT v.view_name as table_name\n , v.database_name\n , v.schema_name\n , 'VIEW' as table_type\n , {{ adapter.catalog_comment('v') }} as table_comment\n from duckdb_views() v\n WHERE v.database_name = '{{ database }}'\n )\n select\n '{{ database }}' as table_database,\n r.schema_name as table_schema,\n r.table_name,\n r.table_type,\n r.table_comment,\n c.column_name,\n c.column_index as column_index,\n c.data_type as column_type,\n {{ adapter.catalog_comment('c') }} as column_comment,\n '' as table_owner\n FROM relations r JOIN duckdb_columns() c ON r.schema_name = c.schema_name AND r.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(r.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ORDER BY\n r.schema_name,\n r.table_name,\n c.column_index\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4618855, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4635005, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4636838, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.466219, "supported_languages": null}, "macro.dbt_duckdb.duckdb_escape_comment": {"name": "duckdb_escape_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb_escape_comment", "macro_sql": "{% macro duckdb_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4674463, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_comment": {"name": "duckdb__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_comment", "macro_sql": "{% macro duckdb__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4677827, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_column_comment": {"name": "duckdb__alter_column_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_column_comment", "macro_sql": "{% macro duckdb__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4686284, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4699202, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4723318, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n date_diff('{{ datepart }}', {{ first_date }}::timestamp, {{ second_date}}::timestamp )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4745893, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n date_add({{ from_date_or_timestamp }}, interval ({{ interval }}) {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4748826, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4755666, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4788377, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4796417, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4804518, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4806476, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4809406, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n -- only create temp tables if using local duckdb, as it is not currently supported for remote databases\n {%- set temporary = not adapter.is_motherduck() -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if not temporary %}\n -- if not using a temporary table we will update the temp relation to use a different temp schema (\"dbt_temp\" by default)\n {% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}\n {% do run_query(create_schema(temp_relation)) %}\n -- then drop the temp relation after we insert the incremental data into the target relation\n {% do to_drop.append(temp_relation) %}\n {% endif %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(temporary, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.create_schema", "macro.dbt.statement", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.489242, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {%- set partition_columns = config.get('partition_columns', []) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.495893, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4996226, "supported_languages": ["sql", "python"]}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5039735, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5047724, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5063608, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5066636, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5068052, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5071802, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.507387, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5080192, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5082638, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5085917, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5089264, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.509079, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.50952, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5097594, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.51014, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5103364, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5107806, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5110216, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5113974, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5116715, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5120597, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.512257, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5125961, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5127766, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5138524, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.514074, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.514307, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5145245, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5147536, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5149682, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5151978, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.515451, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5156832, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5158987, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.516128, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5163374, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5165665, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5167716, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5172818, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5176308, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5180786, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5185688, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5189133, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5190687, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5194554, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5196624, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.520047, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5202467, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.520699, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5210805, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5212934, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.522045, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5226336, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5230675, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523305, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523656, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523813, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5241168, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5242312, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5245323, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5246453, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5250154, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5252078, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5256758, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5258803, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5262153, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5263677, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5266895, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5269148, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.527834, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5284283, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5286982, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5294335, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5302963, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.531148, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5314796, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5320003, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5323505, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5325813, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5332322, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5336182, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5340278, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5345564, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5351014, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.535614, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5360684, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.536531, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5369616, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5373926, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5387418, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.539023, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5392325, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5394378, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5396488, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5698614, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5746737, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5760016, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5763426, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5770545, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5773292, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5775263, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5777295, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5779018, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5781348, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5783076, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.578986, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.579249, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5813012, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5848734, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5899494, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5905094, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5908697, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.592748, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5930786, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5940075, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5976527, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5984945, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6052485, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6150057, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.616932, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6187541, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6200416, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6219764, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6228158, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6238332, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6241946, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.625298, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6317801, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6342804, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6346672, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6361482, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.636536, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6374698, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6420267, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6423974, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6425781, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6429915, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6432412, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6437433, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6443117, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.645543, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6459808, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6462805, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.647158, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6495235, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6530914, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6539319, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6541822, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6544814, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6547265, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6551187, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6558032, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6582146, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6584444, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6588986, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6592155, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6595197, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6597853, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6614661, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6620328, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6623015, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.662799, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6631234, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6640584, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6644216, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6655707, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6660662, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6663334, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6665652, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6668296, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6688917, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6691399, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6694617, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6698835, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6702297, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6706836, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6709416, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6712031, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6715577, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6723475, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.672759, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6729667, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6734946, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6737604, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ compiled_code }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6740324, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6774297, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6778138, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6781063, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6784863, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.678757, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6789882, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6792438, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6796033, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.679896, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6803298, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6805937, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6808238, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6810846, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6813142, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6815548, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6817758, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6820734, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6824002, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6863234, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6864989, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.686737, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6869016, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.687392, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6876583, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6878328, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6881542, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.688453, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6887841, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6890821, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6894846, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6904516, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.690726, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.691082, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6914122, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6930978, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.694641, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.694966, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.69594, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6961412, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6963751, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.69695, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6972146, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.697413, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.697637, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6978185, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6997776, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.701577, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7027779, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7031279, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7051249, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7059567, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7063732, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.706797, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7072492, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7080295, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7083704, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7088068, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7091582, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.709529, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7098396, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7107542, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7124565, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7129276, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.713319, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7139192, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.714558, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.714991, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7152917, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7161336, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7167757, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7170432, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7173314, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.71761, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7184522, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.719079, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7193692, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7198024, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7202942, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7206554, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.721823, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7219963, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.722748, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7229846, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.723182, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.725009, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.725638, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7261314, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7265615, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7267618, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7271314, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7273452, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7277136, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.72792, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7282522, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.728429, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.728793, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.729005, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7297735, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7300417, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7304356, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7306387, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.731, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7312107, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.732233, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7324996, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7331164, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.734311, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.734972, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7352405, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7354994, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7358422, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7360218, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.73639, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.736603, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7375724, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7377837, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7393668, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7396495, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7399895, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7405152, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7407446, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7410028, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7416248, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7419624, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7421396, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7425, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7427118, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.744444, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.744668, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7755525, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7761927, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7770026, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7776418, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7777507, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7784326, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7787836, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7792122, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7796252, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.785041, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7860982, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7873356, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7883582, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7893596, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7906199, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7927077, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7931845, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7935712, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7939658, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7947528, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8030446, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.806573, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.806842, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8070161, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8071308, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.807285, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8075812, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.80801, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8083055, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8087971, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8090208, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8093157, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8134384, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8145819, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8183184, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8207746, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8235774, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8274214, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8290455, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.82959, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.83326, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8399017, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8430264, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8431857, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8433414, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.845307, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8461394, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8467052, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.84726, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8480864, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8487055, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8495398, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8514936, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8519487, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8521109, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.852267, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8524222, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8554294, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8557067, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8560474, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.856281, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8587096, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8602283, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.861041, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8612943, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8615334, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8617716, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8620086, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8622675, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.867719, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8682775, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8694372, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8701513, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8703933, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8706322, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8708942, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8711276, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8713593, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.872903, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8732839, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8736594, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8740263, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.874394, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.874794, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8751945, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8755615, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8760812, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8773916, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8776515, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8790689, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.880004, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8811152, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.881466, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8817508, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8820171, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8822663, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8825207, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8831635, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.883385, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8836026, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.883807, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.88401, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8848386, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8862998, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8868618, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8872232, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.888306, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8892083, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8903158, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8905394, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8911037, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8915627, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8917725, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.891977, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8921742, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.892375, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8927736, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8929389, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8930998, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.89376, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8940804, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8944287, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8948987, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8950748, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8952527, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8954132, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.895581, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8960543, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.896288, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8965967, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8970706, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8979127, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.898373, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8988552, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8994772, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9004714, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9022472, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9051564, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9056625, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.906058, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9065883, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9074216, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9082837, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9095786, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9099972, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9102066, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9106383, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9111586, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9124947, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9148283, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9153097, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.915829, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9190824, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9240117, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.92556, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.927003, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.927945, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.928623, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.928912, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9294496, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9302726, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.930846, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9312804, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.931906, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9321213, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9323297, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.932536, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9335992, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9339275, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9341857, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9344819, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9347386, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9349937, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.935259, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9370544, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9390318, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9398823, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9410558, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9440596, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9446046, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.945582, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.94661, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9473183, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.947945, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.948996, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9501913, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9505985, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.951405, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.952584, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.953104, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.953968, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9549031, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9554915, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.955779, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9566226, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9572604, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9583077, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9591322, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9600074, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9603407, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9608612, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.961435, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.962355, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9628603, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9631941, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9653184, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9710424, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9719188, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9731708, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9742262, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9755402, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.976761, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9782205, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9788802, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9793775, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9827194, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9849827, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9859943, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.987546, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.988251, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9888287, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9917142, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.992209, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9929495, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9939694, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9945939, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9950278, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.995626, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9962993, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.997055, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9977376, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.998272, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9987943, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9996147, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0008843, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.001996, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.003025, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0033846, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0036488, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0042737, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0046487, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0049284, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0052822, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0055194, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0280154, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0282211, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0284297, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0286987, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0288532, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0290556, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.031771, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0321286, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0363913, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0373955, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.037591, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.037784, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0379791, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0417802, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0422177, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0428276, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.043256, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0438924, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0444167, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0446577, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0449715, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.045386, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0462432, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0465415, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0468376, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.047128, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0474272, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0477135, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.048004, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0482955, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.049773, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.050076, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0503008, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0506442, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0509202, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0511937, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0515356, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0518923, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0548964, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0552747, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0557103, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.056394, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0569649, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0578496, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0583575, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0593574, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0596724, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.059978, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0602765, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0605788, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.060858, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0611494, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0614402, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.06226, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.062467, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.062673, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0629332, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.063091, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0632443, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0716338, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0733027, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.074124, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0745597, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0753508, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0762804, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0768795, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.077151, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.077898, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0787365, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.079629, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.079967, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0804837, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0812242, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0823472, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0833163, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0840757, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0852094, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0862582, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0871964, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0882716, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.08975, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.090557, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0917222, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0929334, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.093868, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0949764, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0959713, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0972714, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.097844, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0997834, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1011417, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1026425, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1038702, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1046164, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1062334, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1078725, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1100347, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.112601, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1136043, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1144361, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.12809, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1285386, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1294866, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1300015, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1306627, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1322083, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1328337, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1333401, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1338727, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1346073, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1350338, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1365778, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1381404, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1426873, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1444454, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.145504, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1460207, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.147426, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1509683, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1522908, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1531498, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.153993, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1546392, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1559565, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1563213, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.157525, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1581762, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1588047, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1597285, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1609466, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1623516, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1627092, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1632369, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1637893, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1648965, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.165777, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.166112, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1673398, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1679165, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (value_field {{ operator }} value_field_lag)\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1693983, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (value_field {{ operator }} value_field_lag)\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.171101, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1714451, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1716092, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1761525, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1769793, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1776738, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1794877, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.18009, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1809492, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1821556, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.183244, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1843169, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1847432, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1856341, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1863217, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1866255, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1869276, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1872282, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1876497, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1879013, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1880562, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1882064, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.188355, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1887782, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1888936, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1890037, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1891258, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1892357, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.189347, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1894584, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1897173, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1901, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1904666, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1908443, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1910276, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1911817, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1917825, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1918983, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.19201, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1921208, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1922333, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1924639, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1926582, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1927693, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.19288, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1929882, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1930962, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1932063, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1951926, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1957114, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1963427, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.197046, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1974761, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1979563, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1983814, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1988115, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1996653, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.2001617, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.674048, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6759639, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6820319, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.682475, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.68272, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.682856, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6830695, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6832404, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6835384, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6838717, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where {{ columns.dbt_valid_to }} is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6858084, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6860929, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6867423, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6873453, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6881673, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6887646, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.69001, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6903453, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.690608, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6910224, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.691283, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6917777, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692052, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692426, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692689, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6929064, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6931643, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6933947, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6937966, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6943388, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6949294, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6957083, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6959245, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6961298, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6962826, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6968715, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6971138, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.697227, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6974678, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6977015, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6983795, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6990945, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7000382, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7018573, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7027574, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7039628, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.704261, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7046247, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.704872, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7066529, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.707779, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7087233, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.709778, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7176433, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7211401, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7245598, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.72517, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7254744, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.725676, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7258832, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7267687, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.727036, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7272313, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7274234, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7276278, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7278311, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.728029, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.728227, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7290344, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7292607, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7294638, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7296631, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7298791, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7301087, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7303274, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.730548, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7312353, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7316263, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7324066, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7326474, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7329972, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7332985, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7335207, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7338333, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7341273, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7346215, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7348678, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7351842, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7354686, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.735925, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7361681, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7364857, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.736775, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7372577, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.737509, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7379704, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7382305, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7388604, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7392232, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7394552, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.739619, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7402635, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7404714, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.74088, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.741238, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7414398, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7466946, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.75085, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7516148, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7537115, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7558923, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7574224, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7586315, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7595882, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1725351426.9066834}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.int_disabled_model": [], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.dbt_bouncer_test_project.test_assert_something": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": ["model.dbt_bouncer_test_project.orders"], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "unit_test.dbt_bouncer_test_project.customers.test_clv_logic"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "unit_test.dbt_bouncer_test_project.orders.test_amount_logic"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "test.dbt_bouncer_test_project.test_assert_something": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": [], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": [], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725351426.981751, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}, "unit_tests": {"unit_test.dbt_bouncer_test_project.orders.test_amount_logic": {"model": "orders", "given": [{"input": "ref('stg_orders')", "rows": [{"order_id": 1}, {"order_id": 2}, {"order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"amount": 10, "order_id": 1, "payment_method": "credit_card"}, {"amount": 20, "order_id": 2, "payment_method": "credit_card"}, {"amount": 30, "order_id": 3, "payment_method": "coupon"}], "format": "dict", "fixture": null}], "expect": {"rows": [{"amount": 10, "order_id": 1, "coupon_amount": 0, "credit_card_amount": 10}, {"amount": 20, "order_id": 2, "coupon_amount": 0, "credit_card_amount": 20}, {"amount": 30, "order_id": 3, "coupon_amount": 30, "credit_card_amount": 0}], "format": "dict", "fixture": null}, "name": "test_amount_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders", "test_amount_logic"], "description": "Validate amount logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "config": {"tags": [], "meta": {}}, "checksum": "5b656bfcdd083e4af89f4c506f86484bd9ca1894e07b20a4f8a8f33aaf8a0849", "schema": "main", "created_at": 1725351427.006003, "versions": null, "version": null}, "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": {"model": "customers", "given": [{"input": "ref('stg_customers')", "rows": "select 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name", "format": "sql", "fixture": null}, {"input": "ref('stg_orders')", "rows": [{"customer_id": 1, "order_date": "2022-01-01", "order_id": 1}, {"customer_id": 1, "order_date": "2022-01-02", "order_id": 2}, {"customer_id": 2, "order_date": "2022-01-02", "order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"order_id": "1", "amount": "100"}, {"order_id": "2", "amount": "50"}, {"order_id": "3", "amount": "25"}], "format": "csv", "fixture": "stg_payments"}], "expect": {"rows": [{"customer_id": 1, "customer_lifetime_value": 150}, {"customer_id": 2, "customer_lifetime_value": 25}, {"customer_id": 3, "customer_lifetime_value": 0}], "format": "dict", "fixture": null}, "name": "test_clv_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers", "test_clv_logic"], "description": "Validate CLV logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "config": {"tags": [], "meta": {}}, "checksum": "c42689c77eb9cdd188cb7664846e92985c7d1a130fb02d8f88070d88a047aad2", "schema": "main", "created_at": 1725351427.0083494, "versions": null, "version": null}}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.6", "generated_at": "2024-09-25T09:39:45.566722Z", "invocation_id": "6ebea5f6-f324-478f-a1f5-234b487c9899", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1725351426.7680373, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1725351426.8455946, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1725351426.847957, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1725351426.8630025, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1725351426.8610454, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725351426.8860025, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/customers.sql", "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1725351426.9116123, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/orders.sql", "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1725351426.9160526, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_orders.csv", "unrendered_config": {}, "created_at": 1725351426.2518442, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_payments.csv", "unrendered_config": {}, "created_at": 1725351426.25373, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/seeds/raw_customers.csv", "unrendered_config": {}, "created_at": 1725351426.2554023, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0351233, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.033452, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0296655, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.0402725, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1725351427.03656, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1856692, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1792257, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1804655, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1812165, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1826887, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.177445, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351427.1841698, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.4957714, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.522825, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5285096, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5341895, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5402792, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5827549, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1725351426.5884075, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "unrendered_config": {}, "created_at": 1725351426.8182225, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "unrendered_config": {}, "created_at": 1725351426.8208003, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1725351426.8222895, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.8489718, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.8507996, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.8523633, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.853709, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1725351426.8553824, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1725351426.8638334, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "unrendered_config": {}, "created_at": 1725351426.8758245, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "unrendered_config": {}, "created_at": 1725351426.879734, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1725351426.881098, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "unrendered_config": {}, "created_at": 1725351426.886812, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "unrendered_config": {}, "created_at": 1725351426.8881884, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.9169123, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.918237, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "unrendered_config": {}, "created_at": 1725351426.9195504, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.920879, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "unrendered_config": {}, "created_at": 1725351426.922205, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "unrendered_config": {}, "created_at": 1725351426.9236255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "unrendered_config": {}, "created_at": 1725351426.9249752, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1725351426.9306407, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9339015, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "unrendered_config": {}, "created_at": 1725351426.93564, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9369721, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "unrendered_config": {}, "created_at": 1725351426.938284, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "unrendered_config": {}, "created_at": 1725351426.9396093, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery", "macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.04117, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0427094, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1725351427.0441225, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0513213, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0527382, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1725351427.0541415, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0584738, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.059996, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1725351427.0613737, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0646627, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0660286, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1725351427.0673857, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0706155, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.0719616, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true}, "created_at": 1725351427.073823, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1725351427.0761254, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.1866088, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1725351427.1881363, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.191603, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1725351427.1929796, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.1962543, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1725351427.1976264, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2008693, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1725351427.202261, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2055838, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2069364, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1725351427.2083263, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2115595, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2129295, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1725351427.2142768, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2178245, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725351427.2191455, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1725351427.2204921, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/tests/test_assert_something.sql", "unrendered_config": {}, "created_at": 1725351458.010832, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement"], "nodes": []}, "compiled_path": "target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "dbt_pslattery", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "2337b7104659955eb2d350e6b0a09ba3bdc6c6836ab1b6aebaf91e2ec75c1e8f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "dbt_pslattery", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": "target/run/dbt_bouncer_test_project/snapshots/orders_snapshot.sql", "unrendered_config": {"target_database": "dbt", "target_schema": "dbt_pslattery", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727257185.73287, "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\"", "raw_code": "\n\n {{\n config(\n target_database='dbt' if target.type == 'duckdb' else 'padraic-slattery-sndbx-o',\n target_schema=\"dbt_pslattery\",\n unique_key=\"id\",\n strategy=\"timestamp\",\n updated_at=\"order_date\",\n )\n }}\n\n select *\n from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1725351427.2258704}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1725351427.2270203}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1725351427.2271826}, "source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1725351427.2273881}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1725351427.2275693}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1725351427.2278574}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1725351427.2280595}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1725351427.2283907}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1725351427.2286203}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1725351427.228843}}, "macros": {"macro.dbt_bouncer_test_project.cents_to_dollars": {"name": "cents_to_dollars", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "macros/cents_to_dollars.sql", "original_file_path": "macros/cents_to_dollars.sql", "unique_id": "macro.dbt_bouncer_test_project.cents_to_dollars", "macro_sql": "{% macro cents_to_dollars(column_name) %} ({{ column_name }} / 100) {% endmacro %}", "depends_on": {"macros": []}, "description": "Macro to converts values in cents to dollars", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_macros.yml", "arguments": [{"name": "column_name", "type": null, "description": "A column that contains values in cents"}], "created_at": 1725351426.6519356, "supported_languages": null}, "macro.dbt_bouncer_test_project.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "macros/system/generate_schema_name.sql", "original_file_path": "macros/system/generate_schema_name.sql", "unique_id": "macro.dbt_bouncer_test_project.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name, node) -%}\n {#\n Enter this block when run on stg or prd (except for CICD runs).\n We want the same dataset and table names to be used across all environments.\n For example, `marts.dim_customer` should exist in stg and prd, i.e. there should be no references to the project in the dataset name.\n This will allow other tooling (BI, CICD scripts, etc.) to work across all environments without the need for differing logic per environment.\n #}\n {% if env_var(\"DBT_CICD_RUN\", \"false\") == \"true\" %} {{ env_var(\"DBT_DATASET\") }}\n\n {% elif target.name in [\"stg\", \"prd\"] and env_var(\n \"DBT_CICD_RUN\", \"false\"\n ) == \"false\" %}\n\n {{ node.config.schema }}\n\n {% else %} {{ default__generate_schema_name(custom_schema_name, node) }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "A macro that uses the DBT_DATASET env var only when using the dev target. On the stg and prd targets this env var is not used. This ensures that systems that read from the stg and prd BigQuery instances can use the same dataset and table names, they only need to vary the GCP project id.\n", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/system/_system__macros.yml", "arguments": [{"name": "custom_schema_name", "type": null, "description": "The variable dbt will pass to this macro"}, {"name": "node", "type": null, "description": "The various objects (models, tests, seeds, etc.)"}], "created_at": 1725351426.6557374, "supported_languages": null}, "macro.dbt_bouncer_test_project.test_values_below_threshold": {"name": "test_values_below_threshold", "resource_type": "macro", "package_name": "dbt_bouncer_test_project", "path": "tests/generic/values_below_threshold.sql", "original_file_path": "tests/generic/values_below_threshold.sql", "unique_id": "macro.dbt_bouncer_test_project.test_values_below_threshold", "macro_sql": "{% test values_below_threshold(model, column_name, threshold) %}\n\n with\n validation as (\n\n select count(*) as above_threshold_cnt\n\n from {{ model }}\n where {{ column_name }} > {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1725351426.6535912, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n with relations AS (\n select\n t.table_name\n , t.database_name\n , t.schema_name\n , 'BASE TABLE' as table_type\n , {{ adapter.catalog_comment('t') }} as table_comment\n from duckdb_tables() t\n WHERE t.database_name = '{{ database }}'\n UNION ALL\n SELECT v.view_name as table_name\n , v.database_name\n , v.schema_name\n , 'VIEW' as table_type\n , {{ adapter.catalog_comment('v') }} as table_comment\n from duckdb_views() v\n WHERE v.database_name = '{{ database }}'\n )\n select\n '{{ database }}' as table_database,\n r.schema_name as table_schema,\n r.table_name,\n r.table_type,\n r.table_comment,\n c.column_name,\n c.column_index as column_index,\n c.data_type as column_type,\n {{ adapter.catalog_comment('c') }} as column_comment,\n '' as table_owner\n FROM relations r JOIN duckdb_columns() c ON r.schema_name = c.schema_name AND r.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(r.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ORDER BY\n r.schema_name,\n r.table_name,\n c.column_index\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4618855, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4635005, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4636838, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.466219, "supported_languages": null}, "macro.dbt_duckdb.duckdb_escape_comment": {"name": "duckdb_escape_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb_escape_comment", "macro_sql": "{% macro duckdb_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4674463, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_comment": {"name": "duckdb__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_comment", "macro_sql": "{% macro duckdb__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4677827, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_column_comment": {"name": "duckdb__alter_column_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_column_comment", "macro_sql": "{% macro duckdb__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4686284, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4699202, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4723318, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n date_diff('{{ datepart }}', {{ first_date }}::timestamp, {{ second_date}}::timestamp )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4745893, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n date_add({{ from_date_or_timestamp }}, interval ({{ interval }}) {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4748826, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4755666, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4788377, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4796417, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4804518, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4806476, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4809406, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n -- only create temp tables if using local duckdb, as it is not currently supported for remote databases\n {%- set temporary = not adapter.is_motherduck() -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if not temporary %}\n -- if not using a temporary table we will update the temp relation to use a different temp schema (\"dbt_temp\" by default)\n {% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}\n {% do run_query(create_schema(temp_relation)) %}\n -- then drop the temp relation after we insert the incremental data into the target relation\n {% do to_drop.append(temp_relation) %}\n {% endif %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(temporary, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.create_schema", "macro.dbt.statement", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.489242, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {%- set partition_columns = config.get('partition_columns', []) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.495893, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.4996226, "supported_languages": ["sql", "python"]}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5039735, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5047724, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5063608, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5066636, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5068052, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5071802, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.507387, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5080192, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5082638, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5085917, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5089264, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.509079, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.50952, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5097594, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.51014, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5103364, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5107806, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5110216, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5113974, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5116715, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5120597, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.512257, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5125961, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5127766, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5138524, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.514074, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.514307, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5145245, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5147536, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5149682, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5151978, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.515451, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5156832, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5158987, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.516128, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5163374, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5165665, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5167716, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5172818, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5176308, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5180786, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5185688, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5189133, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5190687, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5194554, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5196624, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.520047, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5202467, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.520699, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5210805, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5212934, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.522045, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5226336, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5230675, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523305, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523656, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.523813, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5241168, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5242312, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5245323, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5246453, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5250154, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5252078, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5256758, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5258803, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5262153, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5263677, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5266895, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5269148, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.527834, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5284283, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5286982, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5294335, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5302963, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.531148, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5314796, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5320003, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5323505, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5325813, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5332322, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5336182, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5340278, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5345564, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5351014, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.535614, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5360684, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.536531, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5369616, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5373926, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5387418, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.539023, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5392325, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5394378, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5396488, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5698614, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5746737, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5760016, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5763426, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5770545, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5773292, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5775263, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5777295, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5779018, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5781348, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5783076, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.578986, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.579249, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5813012, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5848734, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5899494, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5905094, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5908697, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.592748, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5930786, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5940075, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5976527, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.5984945, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6052485, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6150057, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.616932, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6187541, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6200416, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6219764, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6228158, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6238332, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6241946, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.625298, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6317801, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6342804, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6346672, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6361482, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.636536, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6374698, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6420267, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6423974, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6425781, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6429915, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6432412, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6437433, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6443117, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.645543, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6459808, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6462805, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.647158, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6495235, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6530914, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6539319, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6541822, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6544814, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6547265, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6551187, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6558032, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6582146, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6584444, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6588986, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6592155, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6595197, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6597853, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6614661, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6620328, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6623015, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.662799, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6631234, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6640584, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6644216, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6655707, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6660662, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6663334, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6665652, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6668296, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6688917, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6691399, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6694617, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6698835, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6702297, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6706836, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6709416, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6712031, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6715577, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6723475, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.672759, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6729667, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6734946, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6737604, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ compiled_code }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6740324, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6774297, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6778138, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6781063, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6784863, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.678757, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6789882, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6792438, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6796033, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.679896, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6803298, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6805937, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6808238, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6810846, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6813142, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6815548, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6817758, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6820734, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6824002, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6863234, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6864989, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.686737, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6869016, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.687392, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6876583, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6878328, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6881542, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.688453, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6887841, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6890821, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6894846, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6904516, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.690726, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.691082, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6914122, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6930978, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.694641, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.694966, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.69594, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6961412, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6963751, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.69695, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6972146, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.697413, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.697637, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6978185, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.6997776, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.701577, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7027779, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7031279, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7051249, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7059567, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7063732, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.706797, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7072492, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7080295, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7083704, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7088068, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7091582, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.709529, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7098396, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7107542, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7124565, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7129276, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.713319, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7139192, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.714558, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.714991, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7152917, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7161336, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7167757, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7170432, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7173314, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.71761, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7184522, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.719079, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7193692, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7198024, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7202942, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7206554, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.721823, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7219963, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.722748, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7229846, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.723182, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.725009, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.725638, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7261314, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7265615, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7267618, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7271314, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7273452, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7277136, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.72792, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7282522, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.728429, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.728793, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.729005, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7297735, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7300417, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7304356, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7306387, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.731, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7312107, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.732233, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7324996, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7331164, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.734311, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.734972, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7352405, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7354994, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7358422, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7360218, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.73639, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.736603, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7375724, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7377837, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7393668, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7396495, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7399895, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7405152, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7407446, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7410028, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7416248, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7419624, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7421396, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7425, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7427118, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.744444, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.744668, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7755525, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7761927, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7770026, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7776418, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7777507, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7784326, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7787836, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7792122, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7796252, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.785041, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7860982, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7873356, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7883582, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7893596, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7906199, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7927077, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7931845, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7935712, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7939658, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.7947528, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8030446, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.806573, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.806842, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8070161, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8071308, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.807285, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8075812, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.80801, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8083055, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8087971, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8090208, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8093157, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8134384, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8145819, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8183184, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8207746, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8235774, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8274214, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8290455, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.82959, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.83326, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8399017, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8430264, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8431857, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8433414, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.845307, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8461394, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8467052, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.84726, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8480864, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8487055, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8495398, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8514936, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8519487, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8521109, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.852267, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8524222, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8554294, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8557067, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8560474, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.856281, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8587096, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8602283, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.861041, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8612943, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8615334, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8617716, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8620086, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8622675, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.867719, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8682775, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8694372, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8701513, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8703933, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8706322, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8708942, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8711276, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8713593, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.872903, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8732839, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8736594, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8740263, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.874394, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.874794, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8751945, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8755615, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8760812, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8773916, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8776515, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8790689, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.880004, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8811152, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.881466, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8817508, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8820171, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8822663, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8825207, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8831635, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.883385, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8836026, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.883807, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.88401, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8848386, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8862998, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8868618, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8872232, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.888306, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8892083, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8903158, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8905394, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8911037, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8915627, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8917725, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.891977, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8921742, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.892375, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8927736, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8929389, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8930998, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.89376, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8940804, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8944287, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8948987, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8950748, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8952527, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8954132, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.895581, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8960543, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.896288, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8965967, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8970706, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8979127, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.898373, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8988552, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.8994772, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9004714, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9022472, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9051564, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9056625, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.906058, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9065883, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9074216, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9082837, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9095786, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9099972, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9102066, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9106383, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9111586, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9124947, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9148283, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9153097, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.915829, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9190824, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9240117, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.92556, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.927003, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.927945, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.928623, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.928912, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9294496, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9302726, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.930846, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9312804, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.931906, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9321213, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9323297, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.932536, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9335992, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9339275, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9341857, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9344819, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9347386, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9349937, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.935259, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9370544, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9390318, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9398823, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9410558, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9440596, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9446046, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.945582, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.94661, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9473183, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.947945, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.948996, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9501913, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9505985, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.951405, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.952584, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.953104, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.953968, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9549031, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9554915, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.955779, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9566226, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9572604, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9583077, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9591322, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9600074, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9603407, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9608612, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.961435, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.962355, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9628603, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9631941, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9653184, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9710424, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9719188, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9731708, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9742262, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9755402, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.976761, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9782205, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9788802, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9793775, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9827194, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9849827, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9859943, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.987546, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.988251, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9888287, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9917142, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.992209, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9929495, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9939694, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9945939, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9950278, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.995626, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9962993, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.997055, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9977376, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.998272, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9987943, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351424.9996147, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0008843, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.001996, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.003025, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0033846, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0036488, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0042737, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0046487, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0049284, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0052822, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0055194, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0280154, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0282211, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0284297, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0286987, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0288532, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0290556, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.031771, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0321286, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0363913, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0373955, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.037591, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.037784, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0379791, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0417802, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0422177, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0428276, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.043256, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0438924, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0444167, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0446577, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0449715, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.045386, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0462432, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0465415, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0468376, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.047128, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0474272, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0477135, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.048004, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0482955, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.049773, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.050076, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0503008, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0506442, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0509202, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0511937, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0515356, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0518923, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0548964, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0552747, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0557103, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.056394, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0569649, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0578496, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0583575, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0593574, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0596724, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.059978, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0602765, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0605788, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.060858, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0611494, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0614402, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.06226, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.062467, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.062673, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0629332, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.063091, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0632443, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0716338, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0733027, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.074124, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0745597, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0753508, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0762804, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0768795, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.077151, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.077898, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0787365, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.079629, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.079967, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0804837, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0812242, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0823472, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0833163, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0840757, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0852094, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0862582, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0871964, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0882716, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.08975, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.090557, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0917222, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0929334, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.093868, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0949764, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0959713, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0972714, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.097844, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.0997834, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1011417, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1026425, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1038702, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1046164, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1062334, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1078725, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1100347, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.112601, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1136043, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1144361, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.12809, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1285386, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1294866, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1300015, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1306627, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1322083, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1328337, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1333401, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1338727, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1346073, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1350338, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1365778, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1381404, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1426873, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1444454, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.145504, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1460207, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.147426, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1509683, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1522908, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1531498, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.153993, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1546392, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1559565, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1563213, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.157525, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1581762, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1588047, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1597285, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1609466, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1623516, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1627092, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1632369, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1637893, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1648965, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.165777, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.166112, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1673398, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1679165, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1714451, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1716092, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1761525, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1769793, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1776738, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1794877, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.18009, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1809492, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1821556, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.183244, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1843169, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1847432, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1856341, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1863217, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1866255, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1869276, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1872282, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1876497, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1879013, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1880562, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1882064, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.188355, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1887782, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1888936, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1890037, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1891258, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1892357, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.189347, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1894584, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1897173, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1901, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1904666, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1908443, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1910276, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1911817, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1917825, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1918983, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.19201, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1921208, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1922333, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1924639, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1926582, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1927693, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.19288, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1929882, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1930962, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1932063, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1951926, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1957114, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1963427, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.197046, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1974761, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1979563, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1983814, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1988115, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.1996653, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725351425.2001617, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.674048, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6759639, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6820319, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.682475, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.68272, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.682856, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6830695, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6832404, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6835384, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6838717, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where {{ columns.dbt_valid_to }} is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6858084, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6860929, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6867423, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6873453, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6881673, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6887646, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.69001, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6903453, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.690608, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6910224, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.691283, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6917777, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692052, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692426, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.692689, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6929064, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6931643, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6933947, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6937966, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6943388, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6949294, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6957083, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6959245, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6961298, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6962826, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6968715, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6971138, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.697227, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6974678, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6977015, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6983795, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.6990945, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7000382, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7018573, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7027574, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7039628, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.704261, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7046247, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.704872, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7066529, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.707779, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7087233, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.709778, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7176433, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7211401, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7245598, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.72517, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7254744, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.725676, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7258832, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7267687, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.727036, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7272313, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7274234, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7276278, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7278311, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.728029, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.728227, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7290344, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7292607, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7294638, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7296631, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7298791, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7301087, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7303274, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.730548, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7312353, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7316263, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7324066, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7326474, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7329972, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7332985, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7335207, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7338333, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7341273, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7346215, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7348678, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7351842, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7354686, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.735925, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7361681, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7364857, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.736775, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7372577, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.737509, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7379704, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7382305, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7388604, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7392232, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7394552, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.739619, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7402635, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7404714, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.74088, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.741238, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7414398, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7466946, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.75085, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7516148, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7537115, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7558923, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7574224, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7586315, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727106283.7595882, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727256625.7703483, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727256625.772967, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1725351426.9066834}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.int_disabled_model": [], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.dbt_bouncer_test_project.test_assert_something": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": ["model.dbt_bouncer_test_project.orders"], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "unit_test.dbt_bouncer_test_project.customers.test_clv_logic"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "unit_test.dbt_bouncer_test_project.orders.test_amount_logic"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "test.dbt_bouncer_test_project.test_assert_something": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": [], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": [], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725351426.981751, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}, "unit_tests": {"unit_test.dbt_bouncer_test_project.orders.test_amount_logic": {"model": "orders", "given": [{"input": "ref('stg_orders')", "rows": [{"order_id": 1}, {"order_id": 2}, {"order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"amount": 10, "order_id": 1, "payment_method": "credit_card"}, {"amount": 20, "order_id": 2, "payment_method": "credit_card"}, {"amount": 30, "order_id": 3, "payment_method": "coupon"}], "format": "dict", "fixture": null}], "expect": {"rows": [{"amount": 10, "order_id": 1, "coupon_amount": 0, "credit_card_amount": 10}, {"amount": 20, "order_id": 2, "coupon_amount": 0, "credit_card_amount": 20}, {"amount": 30, "order_id": 3, "coupon_amount": 30, "credit_card_amount": 0}], "format": "dict", "fixture": null}, "name": "test_amount_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders", "test_amount_logic"], "description": "Validate amount logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "config": {"tags": [], "meta": {}}, "checksum": "5b656bfcdd083e4af89f4c506f86484bd9ca1894e07b20a4f8a8f33aaf8a0849", "schema": "main", "created_at": 1725351427.006003, "versions": null, "version": null}, "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": {"model": "customers", "given": [{"input": "ref('stg_customers')", "rows": "select 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name", "format": "sql", "fixture": null}, {"input": "ref('stg_orders')", "rows": [{"customer_id": 1, "order_date": "2022-01-01", "order_id": 1}, {"customer_id": 1, "order_date": "2022-01-02", "order_id": 2}, {"customer_id": 2, "order_date": "2022-01-02", "order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"order_id": "1", "amount": "100"}, {"order_id": "2", "amount": "50"}, {"order_id": "3", "amount": "25"}], "format": "csv", "fixture": "stg_payments"}], "expect": {"rows": [{"customer_id": 1, "customer_lifetime_value": 150}, {"customer_id": 2, "customer_lifetime_value": 25}, {"customer_id": 3, "customer_lifetime_value": 0}], "format": "dict", "fixture": null}, "name": "test_clv_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers", "test_clv_logic"], "description": "Validate CLV logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "config": {"tags": [], "meta": {}}, "checksum": "c42689c77eb9cdd188cb7664846e92985c7d1a130fb02d8f88070d88a047aad2", "schema": "main", "created_at": 1725351427.0083494, "versions": null, "version": null}}} diff --git a/dbt_project/target/run_results.json b/dbt_project/target/run_results.json index eeafcf1..ef01f4f 100644 --- a/dbt_project/target/run_results.json +++ b/dbt_project/target/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.6", "generated_at": "2024-09-25T03:14:16.898595Z", "invocation_id": "9537c371-21f2-43c5-9766-659a1dda2cca", "env": {}}, "results": [{"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.468414Z", "completed_at": "2024-09-25T03:14:14.629035Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.717912Z", "completed_at": "2024-09-25T03:14:15.050612Z"}], "thread_id": "Thread-7", "execution_time": 0.6515417098999023, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.820326Z", "completed_at": "2024-09-25T03:14:14.935951Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.947972Z", "completed_at": "2024-09-25T03:14:15.133017Z"}], "thread_id": "Thread-8", "execution_time": 0.4373180866241455, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.869222Z", "completed_at": "2024-09-25T03:14:14.940960Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.972830Z", "completed_at": "2024-09-25T03:14:15.135591Z"}], "thread_id": "Thread-1", "execution_time": 0.40112757682800293, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.879715Z", "completed_at": "2024-09-25T03:14:14.937598Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.958813Z", "completed_at": "2024-09-25T03:14:15.138457Z"}], "thread_id": "Thread-2", "execution_time": 0.3929927349090576, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.467195Z", "completed_at": "2024-09-25T03:14:14.467198Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.592850Z", "completed_at": "2024-09-25T03:14:15.168634Z"}], "thread_id": "Thread-6", "execution_time": 0.7364809513092041, "adapter_response": {"_message": "INSERT 113", "code": "INSERT", "rows_affected": 113}, "message": "INSERT 113", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.466157Z", "completed_at": "2024-09-25T03:14:14.466163Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.480156Z", "completed_at": "2024-09-25T03:14:15.172649Z"}], "thread_id": "Thread-5", "execution_time": 0.7548933029174805, "adapter_response": {"_message": "INSERT 99", "code": "INSERT", "rows_affected": 99}, "message": "INSERT 99", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.464932Z", "completed_at": "2024-09-25T03:14:14.464938Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.474693Z", "completed_at": "2024-09-25T03:14:15.175263Z"}], "thread_id": "Thread-4", "execution_time": 0.757775068283081, "adapter_response": {"_message": "INSERT 100", "code": "INSERT", "rows_affected": 100}, "message": "INSERT 100", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:14.458780Z", "completed_at": "2024-09-25T03:14:14.473896Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:14.682017Z", "completed_at": "2024-09-25T03:14:15.281367Z"}], "thread_id": "Thread-3", "execution_time": 0.8716115951538086, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.187774Z", "completed_at": "2024-09-25T03:14:15.207508Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.211580Z", "completed_at": "2024-09-25T03:14:15.376200Z"}], "thread_id": "Thread-7", "execution_time": 0.24500584602355957, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.419834Z", "completed_at": "2024-09-25T03:14:15.447484Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.455460Z", "completed_at": "2024-09-25T03:14:15.529298Z"}], "thread_id": "Thread-8", "execution_time": 0.15113258361816406, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.429424Z", "completed_at": "2024-09-25T03:14:15.454479Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.463687Z", "completed_at": "2024-09-25T03:14:15.542740Z"}], "thread_id": "Thread-4", "execution_time": 0.15813899040222168, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.239432Z", "completed_at": "2024-09-25T03:14:15.253849Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.273053Z", "completed_at": "2024-09-25T03:14:15.550034Z"}], "thread_id": "Thread-5", "execution_time": 0.33519744873046875, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.267907Z", "completed_at": "2024-09-25T03:14:15.278835Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.299157Z", "completed_at": "2024-09-25T03:14:15.557633Z"}], "thread_id": "Thread-6", "execution_time": 0.3164198398590088, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.255908Z", "completed_at": "2024-09-25T03:14:15.296639Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.306137Z", "completed_at": "2024-09-25T03:14:15.563596Z"}], "thread_id": "Thread-1", "execution_time": 0.32384443283081055, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.261896Z", "completed_at": "2024-09-25T03:14:15.297411Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.312795Z", "completed_at": "2024-09-25T03:14:15.566632Z"}], "thread_id": "Thread-2", "execution_time": 0.3490476608276367, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.708853Z", "completed_at": "2024-09-25T03:14:15.726768Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.737067Z", "completed_at": "2024-09-25T03:14:15.858402Z"}], "thread_id": "Thread-7", "execution_time": 0.2752552032470703, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.717154Z", "completed_at": "2024-09-25T03:14:15.744957Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.778605Z", "completed_at": "2024-09-25T03:14:15.868938Z"}], "thread_id": "Thread-8", "execution_time": 0.28363966941833496, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.624625Z", "completed_at": "2024-09-25T03:14:15.725803Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.732384Z", "completed_at": "2024-09-25T03:14:15.870971Z"}], "thread_id": "Thread-3", "execution_time": 0.2878761291503906, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.745732Z", "completed_at": "2024-09-25T03:14:15.784515Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.794402Z", "completed_at": "2024-09-25T03:14:15.874943Z"}], "thread_id": "Thread-5", "execution_time": 0.18665289878845215, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.751083Z", "completed_at": "2024-09-25T03:14:15.785789Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.798701Z", "completed_at": "2024-09-25T03:14:15.876999Z"}], "thread_id": "Thread-4", "execution_time": 0.18276429176330566, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.756277Z", "completed_at": "2024-09-25T03:14:15.788123Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.803198Z", "completed_at": "2024-09-25T03:14:15.879614Z"}], "thread_id": "Thread-1", "execution_time": 0.18168020248413086, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.767476Z", "completed_at": "2024-09-25T03:14:15.792211Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.811261Z", "completed_at": "2024-09-25T03:14:15.883431Z"}], "thread_id": "Thread-2", "execution_time": 0.18288803100585938, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.772748Z", "completed_at": "2024-09-25T03:14:15.789814Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.806854Z", "completed_at": "2024-09-25T03:14:15.885422Z"}], "thread_id": "Thread-6", "execution_time": 0.1857621669769287, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.931529Z", "completed_at": "2024-09-25T03:14:15.931541Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.946007Z", "completed_at": "2024-09-25T03:14:16.192324Z"}], "thread_id": "Thread-8", "execution_time": 0.2674977779388428, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "compiled": true, "compiled_code": "\n\nwith\n __dbt__cte__stg_orders as (\n\n-- Fixture for stg_orders\nselect \n \n cast(1 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(2 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(3 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\n), __dbt__cte__stg_payments as (\n\n-- Fixture for stg_payments\nselect cast(null as INTEGER) as payment_id, \n \n cast(1 as INTEGER)\n as order_id, \n \n cast('credit_card' as character varying(256))\n as payment_method, \n \n cast(10 as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast(2 as INTEGER)\n as order_id, \n \n cast('credit_card' as character varying(256))\n as payment_method, \n \n cast(20 as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast(3 as INTEGER)\n as order_id, \n \n cast('coupon' as character varying(256))\n as payment_method, \n \n cast(30 as DOUBLE)\n as amount\n), orders as (select * from __dbt__cte__stg_orders),\n\n payments as (select * from __dbt__cte__stg_payments),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:15.930474Z", "completed_at": "2024-09-25T03:14:15.930482Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:15.932875Z", "completed_at": "2024-09-25T03:14:16.197821Z"}], "thread_id": "Thread-7", "execution_time": 0.27754902839660645, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "compiled": true, "compiled_code": "\n\nwith\n __dbt__cte__stg_customers as (\nselect 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name\n), __dbt__cte__stg_orders as (\n\n-- Fixture for stg_orders\nselect \n \n cast(1 as INTEGER)\n as order_id, \n \n cast(1 as INTEGER)\n as customer_id, \n \n cast('2022-01-01' as DATE)\n as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(2 as INTEGER)\n as order_id, \n \n cast(1 as INTEGER)\n as customer_id, \n \n cast('2022-01-02' as DATE)\n as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(3 as INTEGER)\n as order_id, \n \n cast(2 as INTEGER)\n as customer_id, \n \n cast('2022-01-02' as DATE)\n as order_date, cast(null as character varying(256)) as status\n), __dbt__cte__stg_payments as (\n\n-- Fixture for stg_payments\nselect cast(null as INTEGER) as payment_id, \n \n cast('1' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('100' as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast('2' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('50' as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast('3' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('25' as DOUBLE)\n as amount\n), customers as (select * from __dbt__cte__stg_customers),\n\n orders as (select * from __dbt__cte__stg_orders),\n\n payments as (select * from __dbt__cte__stg_payments),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.205464Z", "completed_at": "2024-09-25T03:14:16.216843Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.218265Z", "completed_at": "2024-09-25T03:14:16.402436Z"}], "thread_id": "Thread-8", "execution_time": 0.20422697067260742, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.229762Z", "completed_at": "2024-09-25T03:14:16.246870Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.247914Z", "completed_at": "2024-09-25T03:14:16.413788Z"}], "thread_id": "Thread-7", "execution_time": 0.22791123390197754, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.489991Z", "completed_at": "2024-09-25T03:14:16.525276Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.542185Z", "completed_at": "2024-09-25T03:14:16.630764Z"}], "thread_id": "Thread-2", "execution_time": 0.20572209358215332, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.482121Z", "completed_at": "2024-09-25T03:14:16.520313Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.536661Z", "completed_at": "2024-09-25T03:14:16.632401Z"}], "thread_id": "Thread-1", "execution_time": 0.2096574306488037, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.474034Z", "completed_at": "2024-09-25T03:14:16.514492Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.527823Z", "completed_at": "2024-09-25T03:14:16.634663Z"}], "thread_id": "Thread-4", "execution_time": 0.21468424797058105, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.497381Z", "completed_at": "2024-09-25T03:14:16.526669Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.546497Z", "completed_at": "2024-09-25T03:14:16.637580Z"}], "thread_id": "Thread-6", "execution_time": 0.20820951461791992, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.508806Z", "completed_at": "2024-09-25T03:14:16.534059Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.555285Z", "completed_at": "2024-09-25T03:14:16.639777Z"}], "thread_id": "Thread-8", "execution_time": 0.2062065601348877, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.502586Z", "completed_at": "2024-09-25T03:14:16.531879Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.551201Z", "completed_at": "2024-09-25T03:14:16.641492Z"}], "thread_id": "Thread-3", "execution_time": 0.20959067344665527, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.460223Z", "completed_at": "2024-09-25T03:14:16.496026Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.520991Z", "completed_at": "2024-09-25T03:14:16.643892Z"}], "thread_id": "Thread-5", "execution_time": 0.24814629554748535, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.568422Z", "completed_at": "2024-09-25T03:14:16.584996Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.590606Z", "completed_at": "2024-09-25T03:14:16.671841Z"}], "thread_id": "Thread-7", "execution_time": 0.1645817756652832, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.719945Z", "completed_at": "2024-09-25T03:14:16.753154Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.756658Z", "completed_at": "2024-09-25T03:14:16.822808Z"}], "thread_id": "Thread-1", "execution_time": 0.1350250244140625, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.725630Z", "completed_at": "2024-09-25T03:14:16.754178Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.763184Z", "completed_at": "2024-09-25T03:14:16.827341Z"}], "thread_id": "Thread-4", "execution_time": 0.13547015190124512, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.746152Z", "completed_at": "2024-09-25T03:14:16.784766Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.788577Z", "completed_at": "2024-09-25T03:14:16.841705Z"}], "thread_id": "Thread-8", "execution_time": 0.14966249465942383, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.713531Z", "completed_at": "2024-09-25T03:14:16.754971Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.768759Z", "completed_at": "2024-09-25T03:14:16.846524Z"}], "thread_id": "Thread-2", "execution_time": 0.15940380096435547, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T03:14:16.734822Z", "completed_at": "2024-09-25T03:14:16.774515Z"}, {"name": "execute", "started_at": "2024-09-25T03:14:16.778450Z", "completed_at": "2024-09-25T03:14:16.858243Z"}], "thread_id": "Thread-6", "execution_time": 0.1621706485748291, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}], "elapsed_time": 2.953789710998535, "args": {"exclude_resource_types": [], "quiet": false, "log_file_max_bytes": 10485760, "show_resource_report": false, "enable_legacy_logger": false, "favor_state": false, "strict_mode": false, "log_level": "info", "empty": false, "use_colors": true, "show": false, "macro_debugging": false, "use_colors_file": true, "warn_error_options": {"include": [], "exclude": []}, "exclude": [], "printer_width": 80, "select": [], "version_check": true, "project_dir": "dbt_project", "partial_parse_file_diff": true, "static_parser": true, "which": "build", "indirect_selection": "eager", "require_explicit_package_overrides_for_builtin_materializations": true, "defer": false, "vars": {}, "resource_types": [], "source_freshness_run_project_hooks": false, "invocation_command": "dbt build", "cache_selected_only": false, "introspect": true, "export_saved_queries": false, "log_level_file": "debug", "include_saved_query": false, "require_resource_names_without_spaces": false, "send_anonymous_usage_stats": true, "log_format_file": "debug", "log_path": "dbt_project/logs", "write_json": true, "profiles_dir": "dbt_project", "log_format": "default", "populate_cache": true, "print": true, "partial_parse": true}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.6", "generated_at": "2024-09-25T09:39:50.154679Z", "invocation_id": "6ebea5f6-f324-478f-a1f5-234b487c9899", "env": {}}, "results": [{"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.682355Z", "completed_at": "2024-09-25T09:39:46.950804Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.023199Z", "completed_at": "2024-09-25T09:39:47.254955Z"}], "thread_id": "Thread-7", "execution_time": 0.6280646324157715, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.987586Z", "completed_at": "2024-09-25T09:39:47.097796Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.115664Z", "completed_at": "2024-09-25T09:39:47.281184Z"}], "thread_id": "Thread-1", "execution_time": 0.5330009460449219, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.922876Z", "completed_at": "2024-09-25T09:39:47.093899Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.105208Z", "completed_at": "2024-09-25T09:39:47.292256Z"}], "thread_id": "Thread-8", "execution_time": 0.6894931793212891, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.053958Z", "completed_at": "2024-09-25T09:39:47.102013Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.135972Z", "completed_at": "2024-09-25T09:39:47.305163Z"}], "thread_id": "Thread-2", "execution_time": 0.44199514389038086, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.652821Z", "completed_at": "2024-09-25T09:39:46.652824Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:46.698662Z", "completed_at": "2024-09-25T09:39:47.392112Z"}], "thread_id": "Thread-6", "execution_time": 0.7658414840698242, "adapter_response": {"_message": "INSERT 113", "code": "INSERT", "rows_affected": 113}, "message": "INSERT 113", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.647857Z", "completed_at": "2024-09-25T09:39:46.647866Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:46.655541Z", "completed_at": "2024-09-25T09:39:47.395193Z"}], "thread_id": "Thread-4", "execution_time": 0.7785160541534424, "adapter_response": {"_message": "INSERT 100", "code": "INSERT", "rows_affected": 100}, "message": "INSERT 100", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.651621Z", "completed_at": "2024-09-25T09:39:46.651624Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:46.687621Z", "completed_at": "2024-09-25T09:39:47.405367Z"}], "thread_id": "Thread-5", "execution_time": 0.7828223705291748, "adapter_response": {"_message": "INSERT 99", "code": "INSERT", "rows_affected": 99}, "message": "INSERT 99", "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:46.640607Z", "completed_at": "2024-09-25T09:39:46.672739Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:46.819561Z", "completed_at": "2024-09-25T09:39:47.430200Z"}], "thread_id": "Thread-3", "execution_time": 0.8199610710144043, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.365918Z", "completed_at": "2024-09-25T09:39:47.383486Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.384501Z", "completed_at": "2024-09-25T09:39:47.464399Z"}], "thread_id": "Thread-7", "execution_time": 0.22928309440612793, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.644951Z", "completed_at": "2024-09-25T09:39:47.688367Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.693901Z", "completed_at": "2024-09-25T09:39:47.824420Z"}], "thread_id": "Thread-5", "execution_time": 0.3530921936035156, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.659370Z", "completed_at": "2024-09-25T09:39:47.692131Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.704921Z", "completed_at": "2024-09-25T09:39:47.828191Z"}], "thread_id": "Thread-6", "execution_time": 0.3531639575958252, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.478595Z", "completed_at": "2024-09-25T09:39:47.485145Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.527400Z", "completed_at": "2024-09-25T09:39:47.974470Z"}], "thread_id": "Thread-8", "execution_time": 0.5323240756988525, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.474199Z", "completed_at": "2024-09-25T09:39:47.532631Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.595799Z", "completed_at": "2024-09-25T09:39:47.984274Z"}], "thread_id": "Thread-4", "execution_time": 0.542236328125, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.457687Z", "completed_at": "2024-09-25T09:39:47.470711Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.498273Z", "completed_at": "2024-09-25T09:39:47.988563Z"}], "thread_id": "Thread-2", "execution_time": 0.5510730743408203, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:47.450551Z", "completed_at": "2024-09-25T09:39:47.468156Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:47.485841Z", "completed_at": "2024-09-25T09:39:47.998081Z"}], "thread_id": "Thread-1", "execution_time": 0.5788445472717285, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.201083Z", "completed_at": "2024-09-25T09:39:48.225726Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.256989Z", "completed_at": "2024-09-25T09:39:48.394410Z"}], "thread_id": "Thread-8", "execution_time": 0.395113468170166, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.161886Z", "completed_at": "2024-09-25T09:39:48.214873Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.253845Z", "completed_at": "2024-09-25T09:39:48.405418Z"}], "thread_id": "Thread-5", "execution_time": 0.41178250312805176, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.047834Z", "completed_at": "2024-09-25T09:39:48.211379Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.240334Z", "completed_at": "2024-09-25T09:39:48.417924Z"}], "thread_id": "Thread-3", "execution_time": 0.42218470573425293, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.064675Z", "completed_at": "2024-09-25T09:39:48.213865Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.250714Z", "completed_at": "2024-09-25T09:39:48.445329Z"}], "thread_id": "Thread-7", "execution_time": 0.4421372413635254, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.227857Z", "completed_at": "2024-09-25T09:39:48.270632Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.282566Z", "completed_at": "2024-09-25T09:39:48.456100Z"}], "thread_id": "Thread-4", "execution_time": 0.3271965980529785, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.179659Z", "completed_at": "2024-09-25T09:39:48.226639Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.260303Z", "completed_at": "2024-09-25T09:39:48.458876Z"}], "thread_id": "Thread-6", "execution_time": 0.44280290603637695, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.215529Z", "completed_at": "2024-09-25T09:39:48.274208Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.294650Z", "completed_at": "2024-09-25T09:39:48.460473Z"}], "thread_id": "Thread-2", "execution_time": 0.42043471336364746, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.245227Z", "completed_at": "2024-09-25T09:39:48.276754Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.306022Z", "completed_at": "2024-09-25T09:39:48.464518Z"}], "thread_id": "Thread-1", "execution_time": 0.3094179630279541, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.503935Z", "completed_at": "2024-09-25T09:39:48.503944Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.510287Z", "completed_at": "2024-09-25T09:39:49.055772Z"}], "thread_id": "Thread-5", "execution_time": 0.5730874538421631, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "compiled": true, "compiled_code": "\n\nwith\n __dbt__cte__stg_orders as (\n\n-- Fixture for stg_orders\nselect \n \n cast(1 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(2 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(3 as INTEGER)\n as order_id, cast(null as INTEGER) as customer_id, cast(null as DATE) as order_date, cast(null as character varying(256)) as status\n), __dbt__cte__stg_payments as (\n\n-- Fixture for stg_payments\nselect cast(null as INTEGER) as payment_id, \n \n cast(1 as INTEGER)\n as order_id, \n \n cast('credit_card' as character varying(256))\n as payment_method, \n \n cast(10 as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast(2 as INTEGER)\n as order_id, \n \n cast('credit_card' as character varying(256))\n as payment_method, \n \n cast(20 as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast(3 as INTEGER)\n as order_id, \n \n cast('coupon' as character varying(256))\n as payment_method, \n \n cast(30 as DOUBLE)\n as amount\n), orders as (select * from __dbt__cte__stg_orders),\n\n payments as (select * from __dbt__cte__stg_payments),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:48.502796Z", "completed_at": "2024-09-25T09:39:48.502802Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:48.504884Z", "completed_at": "2024-09-25T09:39:49.063046Z"}], "thread_id": "Thread-8", "execution_time": 0.5807816982269287, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "compiled": true, "compiled_code": "\n\nwith\n __dbt__cte__stg_customers as (\nselect 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name\n), __dbt__cte__stg_orders as (\n\n-- Fixture for stg_orders\nselect \n \n cast(1 as INTEGER)\n as order_id, \n \n cast(1 as INTEGER)\n as customer_id, \n \n cast('2022-01-01' as DATE)\n as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(2 as INTEGER)\n as order_id, \n \n cast(1 as INTEGER)\n as customer_id, \n \n cast('2022-01-02' as DATE)\n as order_date, cast(null as character varying(256)) as status\nunion all\nselect \n \n cast(3 as INTEGER)\n as order_id, \n \n cast(2 as INTEGER)\n as customer_id, \n \n cast('2022-01-02' as DATE)\n as order_date, cast(null as character varying(256)) as status\n), __dbt__cte__stg_payments as (\n\n-- Fixture for stg_payments\nselect cast(null as INTEGER) as payment_id, \n \n cast('1' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('100' as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast('2' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('50' as DOUBLE)\n as amount\nunion all\nselect cast(null as INTEGER) as payment_id, \n \n cast('3' as INTEGER)\n as order_id, cast(null as character varying(256)) as payment_method, \n \n cast('25' as DOUBLE)\n as amount\n), customers as (select * from __dbt__cte__stg_customers),\n\n orders as (select * from __dbt__cte__stg_orders),\n\n payments as (select * from __dbt__cte__stg_payments),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.108640Z", "completed_at": "2024-09-25T09:39:49.115271Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.116336Z", "completed_at": "2024-09-25T09:39:49.444312Z"}], "thread_id": "Thread-8", "execution_time": 0.3487067222595215, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.101862Z", "completed_at": "2024-09-25T09:39:49.121593Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.128153Z", "completed_at": "2024-09-25T09:39:49.440367Z"}], "thread_id": "Thread-5", "execution_time": 0.3692755699157715, "adapter_response": {"_message": "OK"}, "message": "OK", "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.481841Z", "completed_at": "2024-09-25T09:39:49.512318Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.521156Z", "completed_at": "2024-09-25T09:39:49.740940Z"}], "thread_id": "Thread-7", "execution_time": 0.3049588203430176, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.494171Z", "completed_at": "2024-09-25T09:39:49.519933Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.530679Z", "completed_at": "2024-09-25T09:39:49.746825Z"}], "thread_id": "Thread-4", "execution_time": 0.30632853507995605, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.505127Z", "completed_at": "2024-09-25T09:39:49.529183Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.551155Z", "completed_at": "2024-09-25T09:39:49.751026Z"}], "thread_id": "Thread-6", "execution_time": 0.30717945098876953, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.540303Z", "completed_at": "2024-09-25T09:39:49.599004Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.613440Z", "completed_at": "2024-09-25T09:39:49.767470Z"}], "thread_id": "Thread-1", "execution_time": 0.27976346015930176, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.555018Z", "completed_at": "2024-09-25T09:39:49.602520Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.623606Z", "completed_at": "2024-09-25T09:39:49.770539Z"}], "thread_id": "Thread-8", "execution_time": 0.2814352512359619, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.545431Z", "completed_at": "2024-09-25T09:39:49.604075Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.633843Z", "completed_at": "2024-09-25T09:39:49.772621Z"}], "thread_id": "Thread-3", "execution_time": 0.2836289405822754, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.569094Z", "completed_at": "2024-09-25T09:39:49.610297Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.644278Z", "completed_at": "2024-09-25T09:39:49.776541Z"}], "thread_id": "Thread-2", "execution_time": 0.28336620330810547, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.579618Z", "completed_at": "2024-09-25T09:39:49.611898Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.653718Z", "completed_at": "2024-09-25T09:39:49.784302Z"}], "thread_id": "Thread-5", "execution_time": 0.29306912422180176, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.889243Z", "completed_at": "2024-09-25T09:39:49.916476Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.966247Z", "completed_at": "2024-09-25T09:39:50.076937Z"}], "thread_id": "Thread-6", "execution_time": 0.24392294883728027, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.878951Z", "completed_at": "2024-09-25T09:39:49.926914Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.978090Z", "completed_at": "2024-09-25T09:39:50.097541Z"}], "thread_id": "Thread-4", "execution_time": 0.26668524742126465, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.859218Z", "completed_at": "2024-09-25T09:39:49.906159Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.945219Z", "completed_at": "2024-09-25T09:39:50.104803Z"}], "thread_id": "Thread-7", "execution_time": 0.28829264640808105, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.929713Z", "completed_at": "2024-09-25T09:39:49.993206Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:50.003124Z", "completed_at": "2024-09-25T09:39:50.109414Z"}], "thread_id": "Thread-8", "execution_time": 0.24332356452941895, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "pass", "timing": [{"name": "compile", "started_at": "2024-09-25T09:39:49.900895Z", "completed_at": "2024-09-25T09:39:49.991039Z"}, {"name": "execute", "started_at": "2024-09-25T09:39:49.995254Z", "completed_at": "2024-09-25T09:39:50.113903Z"}], "thread_id": "Thread-1", "execution_time": 0.26709866523742676, "adapter_response": {"_message": "OK"}, "message": null, "failures": 0, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}], "elapsed_time": 3.8706812858581543, "args": {"defer": false, "warn_error_options": {"include": [], "exclude": []}, "exclude": [], "invocation_command": "dbt build", "use_colors_file": true, "partial_parse": true, "populate_cache": true, "partial_parse_file_diff": true, "empty": false, "exclude_resource_types": [], "quiet": false, "which": "build", "printer_width": 80, "log_file_max_bytes": 10485760, "cache_selected_only": false, "send_anonymous_usage_stats": true, "vars": {}, "log_path": "dbt_project/logs", "macro_debugging": false, "require_explicit_package_overrides_for_builtin_materializations": true, "log_format_file": "debug", "print": true, "project_dir": "dbt_project", "resource_types": [], "show": false, "enable_legacy_logger": false, "favor_state": false, "use_colors": true, "log_format": "default", "introspect": true, "indirect_selection": "eager", "select": [], "log_level_file": "debug", "write_json": true, "strict_mode": false, "export_saved_queries": false, "log_level": "info", "profiles_dir": "dbt_project", "static_parser": true, "version_check": true, "source_freshness_run_project_hooks": false, "include_saved_query": false, "require_resource_names_without_spaces": false, "show_resource_report": false}} diff --git a/tests/fixtures/dbt_16/target/catalog.json b/tests/fixtures/dbt_16/target/catalog.json index 039e3a8..15347b7 100644 --- a/tests/fixtures/dbt_16/target/catalog.json +++ b/tests/fixtures/dbt_16/target/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T07:11:53.331619Z", "invocation_id": "f3a1b3b9-7096-4484-a7d6-963ea52d78af", "env": {}}, "nodes": {"model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.int_model_1": {"metadata": {"type": "VIEW", "schema": "main", "name": "int_model_1", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.int_model_1"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_group_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "advertiser_id", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "action_days": {"type": "DECIMAL(28,6)", "index": 6, "name": "action_days", "comment": null}, "action_categories": {"type": "VARCHAR", "index": 7, "name": "action_categories", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "age_groups": {"type": "VARCHAR", "index": 9, "name": "age_groups", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 10, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 11, "name": "budget", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 12, "name": "category", "comment": null}, "display_name": {"type": "VARCHAR", "index": 13, "name": "display_name", "comment": null}, "interest_category": {"type": "VARCHAR", "index": 14, "name": "interest_category", "comment": null}, "frequency": {"type": "DECIMAL(28,6)", "index": 15, "name": "frequency", "comment": null}, "frequency_schedule": {"type": "DECIMAL(28,6)", "index": 16, "name": "frequency_schedule", "comment": null}, "gender": {"type": "VARCHAR", "index": 17, "name": "gender", "comment": null}, "languages": {"type": "VARCHAR", "index": 18, "name": "languages", "comment": null}, "landing_page_url": {"type": "VARCHAR", "index": 19, "name": "landing_page_url", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 20, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_group_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "ad_group_id", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "advertiser_id", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 6, "name": "campaign_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 7, "name": "ad_name", "comment": null}, "call_to_action": {"type": "VARCHAR", "index": 8, "name": "call_to_action", "comment": null}, "click_tracking_url": {"type": "VARCHAR", "index": 9, "name": "click_tracking_url", "comment": null}, "impression_tracking_url": {"type": "VARCHAR", "index": 10, "name": "impression_tracking_url", "comment": null}, "base_url": {"type": "VARCHAR", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "VARCHAR", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "VARCHAR", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "VARCHAR", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "VARCHAR", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "VARCHAR", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "VARCHAR", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "VARCHAR", "index": 18, "name": "utm_term", "comment": null}, "landing_page_url": {"type": "VARCHAR", "index": 19, "name": "landing_page_url", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 20, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "advertiser_id", "comment": null}, "address": {"type": "VARCHAR", "index": 3, "name": "address", "comment": null}, "balance": {"type": "FLOAT", "index": 4, "name": "balance", "comment": null}, "company": {"type": "VARCHAR", "index": 5, "name": "company", "comment": null}, "contacter": {"type": "VARCHAR", "index": 6, "name": "contacter", "comment": null}, "country": {"type": "VARCHAR", "index": 7, "name": "country", "comment": null}, "currency": {"type": "VARCHAR", "index": 8, "name": "currency", "comment": null}, "description": {"type": "VARCHAR", "index": 9, "name": "description", "comment": null}, "email": {"type": "VARCHAR", "index": 10, "name": "email", "comment": null}, "industry": {"type": "VARCHAR", "index": 11, "name": "industry", "comment": null}, "language": {"type": "VARCHAR", "index": 12, "name": "language", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 13, "name": "advertiser_name", "comment": null}, "cellphone_number": {"type": "VARCHAR", "index": 14, "name": "cellphone_number", "comment": null}, "telephone_number": {"type": "VARCHAR", "index": 15, "name": "telephone_number", "comment": null}, "timezone": {"type": "VARCHAR", "index": 16, "name": "timezone", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "advertiser_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 5, "name": "campaign_name", "comment": null}, "campaign_type": {"type": "VARCHAR", "index": 6, "name": "campaign_type", "comment": null}, "split_test_variable": {"type": "VARCHAR", "index": 7, "name": "split_test_variable", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 8, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "campaign_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 9, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 10, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 11, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 12, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 13, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 14, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 15, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 16, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 17, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 18, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 19, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 20, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 21, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 22, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 23, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 24, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 25, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 26, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 27, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 28, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 29, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 30, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 31, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "model.tiktok_ads.tiktok_ads__ad_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 9, "name": "ad_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 10, "name": "ad_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 11, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 12, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 13, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 14, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 15, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 16, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 17, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 18, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 19, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 20, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 21, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 22, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 23, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 24, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 25, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 26, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 27, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 28, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 29, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 30, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 31, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 32, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 33, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__ad_report"}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 5, "name": "currency", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 6, "name": "clicks", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 7, "name": "impressions", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 8, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 9, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 10, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 11, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 12, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 13, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 14, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 15, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 16, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 17, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 18, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 19, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 20, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 21, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 22, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 23, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "model.tiktok_ads.tiktok_ads__campaign_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 7, "name": "currency", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 8, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 9, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 10, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 11, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 12, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 13, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 14, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 15, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 16, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 17, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 18, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 19, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 20, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 21, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 22, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 23, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 24, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 25, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report"}, "model.tiktok_ads.tiktok_ads__url_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 9, "name": "ad_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 10, "name": "ad_name", "comment": null}, "base_url": {"type": "VARCHAR", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "VARCHAR", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "VARCHAR", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "VARCHAR", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "VARCHAR", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "VARCHAR", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "VARCHAR", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "VARCHAR", "index": 18, "name": "utm_term", "comment": null}, "currency": {"type": "VARCHAR", "index": 19, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 20, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 21, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 22, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 23, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 24, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 25, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 26, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 27, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 28, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 29, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 30, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 31, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 32, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 33, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 34, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 35, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 36, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 37, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 38, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 39, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 40, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 41, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__url_report"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "snapshots", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}}, "sources": {}, "errors": null} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T09:40:15.413411Z", "invocation_id": "05e959b9-6f4a-4e69-b3fe-525577e156e9", "env": {}}, "nodes": {"snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "dbt_pslattery", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}, "model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.int_model_1": {"metadata": {"type": "VIEW", "schema": "main", "name": "int_model_1", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.int_model_1"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_group_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "advertiser_id", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "action_days": {"type": "DECIMAL(28,6)", "index": 6, "name": "action_days", "comment": null}, "action_categories": {"type": "VARCHAR", "index": 7, "name": "action_categories", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "age_groups": {"type": "VARCHAR", "index": 9, "name": "age_groups", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 10, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 11, "name": "budget", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 12, "name": "category", "comment": null}, "display_name": {"type": "VARCHAR", "index": 13, "name": "display_name", "comment": null}, "interest_category": {"type": "VARCHAR", "index": 14, "name": "interest_category", "comment": null}, "frequency": {"type": "DECIMAL(28,6)", "index": 15, "name": "frequency", "comment": null}, "frequency_schedule": {"type": "DECIMAL(28,6)", "index": 16, "name": "frequency_schedule", "comment": null}, "gender": {"type": "VARCHAR", "index": 17, "name": "gender", "comment": null}, "languages": {"type": "VARCHAR", "index": 18, "name": "languages", "comment": null}, "landing_page_url": {"type": "VARCHAR", "index": 19, "name": "landing_page_url", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 20, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_group_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "ad_group_id", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "advertiser_id", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 6, "name": "campaign_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 7, "name": "ad_name", "comment": null}, "call_to_action": {"type": "VARCHAR", "index": 8, "name": "call_to_action", "comment": null}, "click_tracking_url": {"type": "VARCHAR", "index": 9, "name": "click_tracking_url", "comment": null}, "impression_tracking_url": {"type": "VARCHAR", "index": 10, "name": "impression_tracking_url", "comment": null}, "base_url": {"type": "VARCHAR", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "VARCHAR", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "VARCHAR", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "VARCHAR", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "VARCHAR", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "VARCHAR", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "VARCHAR", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "VARCHAR", "index": 18, "name": "utm_term", "comment": null}, "landing_page_url": {"type": "VARCHAR", "index": 19, "name": "landing_page_url", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 20, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "ad_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "advertiser_id", "comment": null}, "address": {"type": "VARCHAR", "index": 3, "name": "address", "comment": null}, "balance": {"type": "FLOAT", "index": 4, "name": "balance", "comment": null}, "company": {"type": "VARCHAR", "index": 5, "name": "company", "comment": null}, "contacter": {"type": "VARCHAR", "index": 6, "name": "contacter", "comment": null}, "country": {"type": "VARCHAR", "index": 7, "name": "country", "comment": null}, "currency": {"type": "VARCHAR", "index": 8, "name": "currency", "comment": null}, "description": {"type": "VARCHAR", "index": 9, "name": "description", "comment": null}, "email": {"type": "VARCHAR", "index": 10, "name": "email", "comment": null}, "industry": {"type": "VARCHAR", "index": 11, "name": "industry", "comment": null}, "language": {"type": "VARCHAR", "index": 12, "name": "language", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 13, "name": "advertiser_name", "comment": null}, "cellphone_number": {"type": "VARCHAR", "index": 14, "name": "cellphone_number", "comment": null}, "telephone_number": {"type": "VARCHAR", "index": 15, "name": "telephone_number", "comment": null}, "timezone": {"type": "VARCHAR", "index": 16, "name": "timezone", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "campaign_id", "comment": null}, "updated_at": {"type": "TIMESTAMP", "index": 3, "name": "updated_at", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 4, "name": "advertiser_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 5, "name": "campaign_name", "comment": null}, "campaign_type": {"type": "VARCHAR", "index": 6, "name": "campaign_type", "comment": null}, "split_test_variable": {"type": "VARCHAR", "index": 7, "name": "split_test_variable", "comment": null}, "is_most_recent_record": {"type": "BOOLEAN", "index": 8, "name": "is_most_recent_record", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"metadata": {"type": "BASE TABLE", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 2, "name": "campaign_id", "comment": null}, "stat_time_hour": {"type": "TIMESTAMP", "index": 3, "name": "stat_time_hour", "comment": null}, "cpc": {"type": "FLOAT", "index": 4, "name": "cpc", "comment": null}, "cpm": {"type": "FLOAT", "index": 5, "name": "cpm", "comment": null}, "ctr": {"type": "FLOAT", "index": 6, "name": "ctr", "comment": null}, "impressions": {"type": "DECIMAL(28,6)", "index": 7, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(28,6)", "index": 8, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(28,6)", "index": 9, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(28,6)", "index": 10, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(28,6)", "index": 11, "name": "conversion", "comment": null}, "cost_per_conversion": {"type": "FLOAT", "index": 12, "name": "cost_per_conversion", "comment": null}, "conversion_rate": {"type": "FLOAT", "index": 13, "name": "conversion_rate", "comment": null}, "likes": {"type": "DECIMAL(28,6)", "index": 14, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(28,6)", "index": 15, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(28,6)", "index": 16, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(28,6)", "index": 17, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(28,6)", "index": 18, "name": "follows", "comment": null}, "video_play_actions": {"type": "DECIMAL(28,6)", "index": 19, "name": "video_play_actions", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(28,6)", "index": 20, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(28,6)", "index": 21, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(28,6)", "index": 22, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(28,6)", "index": 23, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(28,6)", "index": 24, "name": "video_views_p_75", "comment": null}, "average_video_play": {"type": "FLOAT", "index": 25, "name": "average_video_play", "comment": null}, "average_video_play_per_user": {"type": "FLOAT", "index": 26, "name": "average_video_play_per_user", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"metadata": {"type": "VIEW", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "database": "dbt", "comment": null, "owner": null}, "columns": {"_dbt_source_relation": {"type": "VARCHAR", "index": 1, "name": "_dbt_source_relation", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 9, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 10, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 11, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 12, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 13, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 14, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 15, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 16, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 17, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 18, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 19, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 20, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 21, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 22, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 23, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 24, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 25, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 26, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 27, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 28, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 29, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 30, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 31, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "model.tiktok_ads.tiktok_ads__ad_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 9, "name": "ad_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 10, "name": "ad_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 11, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 12, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 13, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 14, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 15, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 16, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 17, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 18, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 19, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 20, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 21, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 22, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 23, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 24, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 25, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 26, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 27, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 28, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 29, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 30, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 31, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 32, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 33, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__ad_report"}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 5, "name": "currency", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 6, "name": "clicks", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 7, "name": "impressions", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 8, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 9, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 10, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 11, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 12, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 13, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 14, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 15, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 16, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 17, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 18, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 19, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 20, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 21, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 22, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 23, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "model.tiktok_ads.tiktok_ads__campaign_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "currency": {"type": "VARCHAR", "index": 7, "name": "currency", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 8, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 9, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 10, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 11, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 12, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 13, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 14, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 15, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 16, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 17, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 18, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 19, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 20, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 21, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 22, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 23, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 24, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 25, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report"}, "model.tiktok_ads.tiktok_ads__url_report": {"metadata": {"type": "BASE TABLE", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "database": "dbt", "comment": null, "owner": null}, "columns": {"source_relation": {"type": "VARCHAR", "index": 1, "name": "source_relation", "comment": null}, "date_day": {"type": "DATE", "index": 2, "name": "date_day", "comment": null}, "advertiser_id": {"type": "DECIMAL(28,6)", "index": 3, "name": "advertiser_id", "comment": null}, "advertiser_name": {"type": "VARCHAR", "index": 4, "name": "advertiser_name", "comment": null}, "campaign_id": {"type": "DECIMAL(28,6)", "index": 5, "name": "campaign_id", "comment": null}, "campaign_name": {"type": "VARCHAR", "index": 6, "name": "campaign_name", "comment": null}, "ad_group_id": {"type": "DECIMAL(28,6)", "index": 7, "name": "ad_group_id", "comment": null}, "ad_group_name": {"type": "VARCHAR", "index": 8, "name": "ad_group_name", "comment": null}, "ad_id": {"type": "DECIMAL(28,6)", "index": 9, "name": "ad_id", "comment": null}, "ad_name": {"type": "VARCHAR", "index": 10, "name": "ad_name", "comment": null}, "base_url": {"type": "VARCHAR", "index": 11, "name": "base_url", "comment": null}, "url_host": {"type": "VARCHAR", "index": 12, "name": "url_host", "comment": null}, "url_path": {"type": "VARCHAR", "index": 13, "name": "url_path", "comment": null}, "utm_source": {"type": "VARCHAR", "index": 14, "name": "utm_source", "comment": null}, "utm_medium": {"type": "VARCHAR", "index": 15, "name": "utm_medium", "comment": null}, "utm_campaign": {"type": "VARCHAR", "index": 16, "name": "utm_campaign", "comment": null}, "utm_content": {"type": "VARCHAR", "index": 17, "name": "utm_content", "comment": null}, "utm_term": {"type": "VARCHAR", "index": 18, "name": "utm_term", "comment": null}, "currency": {"type": "VARCHAR", "index": 19, "name": "currency", "comment": null}, "category": {"type": "DECIMAL(28,6)", "index": 20, "name": "category", "comment": null}, "gender": {"type": "VARCHAR", "index": 21, "name": "gender", "comment": null}, "audience_type": {"type": "VARCHAR", "index": 22, "name": "audience_type", "comment": null}, "budget": {"type": "FLOAT", "index": 23, "name": "budget", "comment": null}, "impressions": {"type": "DECIMAL(38,6)", "index": 24, "name": "impressions", "comment": null}, "clicks": {"type": "DECIMAL(38,6)", "index": 25, "name": "clicks", "comment": null}, "spend": {"type": "DECIMAL(38,6)", "index": 26, "name": "spend", "comment": null}, "reach": {"type": "DECIMAL(38,6)", "index": 27, "name": "reach", "comment": null}, "conversion": {"type": "DECIMAL(38,6)", "index": 28, "name": "conversion", "comment": null}, "likes": {"type": "DECIMAL(38,6)", "index": 29, "name": "likes", "comment": null}, "comments": {"type": "DECIMAL(38,6)", "index": 30, "name": "comments", "comment": null}, "shares": {"type": "DECIMAL(38,6)", "index": 31, "name": "shares", "comment": null}, "profile_visits": {"type": "DECIMAL(38,6)", "index": 32, "name": "profile_visits", "comment": null}, "follows": {"type": "DECIMAL(38,6)", "index": 33, "name": "follows", "comment": null}, "video_watched_2_s": {"type": "DECIMAL(38,6)", "index": 34, "name": "video_watched_2_s", "comment": null}, "video_watched_6_s": {"type": "DECIMAL(38,6)", "index": 35, "name": "video_watched_6_s", "comment": null}, "video_views_p_25": {"type": "DECIMAL(38,6)", "index": 36, "name": "video_views_p_25", "comment": null}, "video_views_p_50": {"type": "DECIMAL(38,6)", "index": 37, "name": "video_views_p_50", "comment": null}, "video_views_p_75": {"type": "DECIMAL(38,6)", "index": 38, "name": "video_views_p_75", "comment": null}, "daily_cpc": {"type": "DOUBLE", "index": 39, "name": "daily_cpc", "comment": null}, "daily_cpm": {"type": "DOUBLE", "index": 40, "name": "daily_cpm", "comment": null}, "daily_ctr": {"type": "DOUBLE", "index": 41, "name": "daily_ctr", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.tiktok_ads.tiktok_ads__url_report"}}, "sources": {}, "errors": null} diff --git a/tests/fixtures/dbt_16/target/manifest.json b/tests/fixtures/dbt_16/target/manifest.json index d474ab0..0faa077 100644 --- a/tests/fixtures/dbt_16/target/manifest.json +++ b/tests/fixtures/dbt_16/target/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v10.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T07:11:52.054559Z", "invocation_id": "f3a1b3b9-7096-4484-a7d6-963ea52d78af", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449561.798907, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449561.8256264, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449561.8359013, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true}, "access": "public", "post-hook": [], "pre-hook": []}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449561.8604298, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4511847, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4553041, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4595659, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9611962, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9593256, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9548697, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.966592, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.962744, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0610158, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.054893, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.056103, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0568664, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0582566, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0532146, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.059625, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7046132, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.725476, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7298582, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7338846, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.738564, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7425964, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7466493, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.810583, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8118308, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449561.8130412, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8284585, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8295715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449561.831007, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8365092, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8394988, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449561.8407967, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8631747, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8642366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8655326, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8666131, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449561.8712418, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8737586, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8748631, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8763008, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8775678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8787775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9675243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9693432, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449561.9709876, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9789839, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9803555, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449561.9817505, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9854095, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9870067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449561.988654, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9922721, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.994176, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449561.9954035, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9989605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.000157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1723449562.0017834, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449562.0035355, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0619245, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449562.063495, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0671086, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449562.0693965, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0738366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449562.075331, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.078562, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449562.0796297, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.082224, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0835142, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449562.0845788, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0872235, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0884833, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449562.089618, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0921292, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0934248, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449562.0945861, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450315.7829788, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450315.8168404, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450315.8190255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136581.067327, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136581.0791683, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model"}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true}, "access": "public", "post-hook": [], "pre-hook": []}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602068.9390628, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9506948, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9519544, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9532511, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381704.531615, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.504824, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.548347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.5500321, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "snapshots", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "66c7297a2e7bafae8b9569abeee9f364001518a84ee37f26c722b00dcb9b3d3f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "snapshots", "target_database": "dbt", "updated_at": "order_date", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_database": "dbt", "target_schema": "snapshots", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727248307.566013, "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\"", "raw_code": "\n\n{{\n config(\n target_database='dbt',\n target_schema='snapshots',\n unique_key='id',\n\n strategy='timestamp',\n updated_at='order_date',\n )\n}}\n\nselect * from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449562.097551}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449562.097694}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449562.0979037}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449562.098049}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449562.0982049}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449562.0985532}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449562.0987058}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450315.8490653}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450315.8492167}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450315.8493302}}, "macros": {"macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3907254, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3909812, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3913608, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.391663, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3920808, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.393275, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3934507, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3939273, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.394522, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.394881, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.395109, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3954344, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3957927, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3958757, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.396058, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3961682, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3963244, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.396564, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3968086, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3971038, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% for k in options %}\n {% if options[k] is string %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% else %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endif %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.398336, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n select\n '{{ database }}' as table_database,\n t.table_schema,\n t.table_name,\n t.table_type,\n '' as table_comment,\n c.column_name,\n c.ordinal_position as column_index,\n c.data_type column_type,\n '' as column_comment,\n '' as table_owner\n FROM information_schema.tables t JOIN information_schema.columns c ON t.table_schema = c.table_schema AND t.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(t.table_schema) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n AND t.table_type IN ('BASE TABLE', 'VIEW')\n ORDER BY\n t.table_schema,\n t.table_name,\n c.ordinal_position\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3990405, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4002647, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4003937, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE)\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4023612, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4034038, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4052565, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.406209, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4066675, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4068289, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4099777, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.410223, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4107518, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4132404, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4138668, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4145193, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4146583, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4148679, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(True, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.statement", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4206395, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.425707, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4284923, "supported_languages": ["sql", "python"]}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.428782, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.428932, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4294407, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.429642, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4299147, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4301996, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4303281, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4307039, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4308925, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4311748, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4313195, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4316528, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4318244, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4320965, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.43224, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4324825, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4326136, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4334445, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4336145, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4337907, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.43396, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4341364, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4343011, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4345484, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4347372, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4349055, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4350626, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.435227, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4353755, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4355397, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4356894, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4360611, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4363134, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4365578, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4366677, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4369624, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4371088, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.437412, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4375758, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4379432, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4382255, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4383762, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4389386, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.439369, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4396837, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4398541, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.440095, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4402049, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4404325, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.440514, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4407272, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4408934, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.441165, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4413, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4415913, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4417448, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4419973, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.442115, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.44235, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4425137, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4427583, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4429224, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4434009, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4436817, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4439855, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4443707, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.444764, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4451437, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4454188, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.445772, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4461033, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4464297, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4474847, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.447692, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.447847, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4479995, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4481518, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4539795, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4544306, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.454728, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4578888, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4582074, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4583986, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4585047, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.458672, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.458804, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4590356, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4600732, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4602895, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4605792, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.461061, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4643033, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4644904, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4647477, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.465538, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4657273, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4659338, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4674535, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4690592, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4726355, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4764824, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4774618, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4777105, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4782274, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4784286, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4785738, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4787254, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.478848, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4790168, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.479142, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4796462, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4798412, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.48116, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_as_sql": {"name": "get_replace_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "unique_id": "macro.dbt.get_replace_materialized_view_as_sql", "macro_sql": "{% macro get_replace_materialized_view_as_sql(relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {{- log('Applying REPLACE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_replace_materialized_view_as_sql', 'dbt')(relation, sql, existing_relation, backup_relation, intermediate_relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4815974, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_as_sql": {"name": "default__get_replace_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_as_sql", "macro_sql": "{% macro default__get_replace_materialized_view_as_sql(relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4817867, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4822607, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.482463, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "original_file_path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4828763, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "original_file_path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4830303, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4833648, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4835317, "supported_languages": null}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4880648, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.488616, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4889224, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_materialized_view_as_sql(target_relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_materialized_view_as_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4904976, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.490772, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4915497, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4919055, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4920633, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4927607, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.498466, "supported_languages": ["sql"]}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4993896, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4996479, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4998527, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5001757, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5003862, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5007157, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5009205, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5011988, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5013986, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5015752, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5019002, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5064988, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5077899, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5091558, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5100772, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5115416, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5121188, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.512817, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5130568, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.513812, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5189037, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5206394, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5209143, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.522006, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.522284, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5229695, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.526083, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5263412, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5264661, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5267584, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.526902, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.527676, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5278707, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5283177, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.529037, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5295272, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5297506, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.529963, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5325866, "supported_languages": ["sql"]}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5335255, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.533656, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5342312, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5344043, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.534548, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.535914, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5363173, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5366805, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5371044, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5372782, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5374854, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.537981, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5394964, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.542119, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.54246, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5427148, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5430717, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.543482, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5438955, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5442185, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.546299, "supported_languages": ["sql"]}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5470974, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {%- if relation.is_table -%}\n {{- drop_table(relation) -}}\n {%- elif relation.is_view -%}\n {{- drop_view(relation) -}}\n {%- elif relation.is_materialized_view -%}\n {{- drop_materialized_view(relation) -}}\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endif -%}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.drop_table", "macro.dbt.drop_view", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5475767, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{ return(adapter.dispatch('drop_table', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.547775, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5478892, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{ return(adapter.dispatch('drop_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5480773, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5484853, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{ return(adapter.dispatch('drop_materialized_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5486853, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5488043, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5494304, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5496182, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5498347, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.550014, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5502872, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5507913, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5526664, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.552844, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553187, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5534184, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553654, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553873, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n cast(null as {{ col['data_type'] }}) as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5547442, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5551102, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5552998, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5556712, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5559056, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5565345, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5568066, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5576742, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5581021, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.558321, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.558497, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5586948, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5610585, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.561244, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5614843, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5618138, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5620823, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5624301, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.562621, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5627966, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5630093, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5633154, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5635722, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.564142, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5643845, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5645375, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5647528, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.566168, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5664577, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5666516, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5668216, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5670176, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5672822, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5674984, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5678205, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5680122, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.568185, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5686388, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.568808, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5689707, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5691733, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5693545, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5694406, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5696318, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.569824, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5713298, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.571468, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5716598, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5717897, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.572199, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5724158, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5725393, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5727935, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5730069, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5732567, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.573466, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.573708, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.57443, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.574618, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5748768, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.575109, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5763047, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.576732, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.577167, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.577464, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5777276, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5785117, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5787394, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5789049, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5793424, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.57954, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.579691, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.579859, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5799944, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.581597, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.583009, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5838404, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.584117, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5857966, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5864527, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.586784, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5871148, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5874732, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5880592, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.588311, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5898674, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5900512, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5909657, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5914044, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5920343, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.592539, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5926201, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5931215, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.593371, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5937965, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.594122, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.598862, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5996869, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6007578, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6017082, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6026156, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6037545, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6057758, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.606229, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6065898, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.606943, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6076198, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.617837, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.622924, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6232927, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6235204, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.623665, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.623861, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6242344, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.624703, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.624927, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6253629, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.625561, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6258297, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.629263, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6301389, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6335135, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6359384, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.638758, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6417975, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6429508, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6433537, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.646367, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6512556, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6520326, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6534178, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6537116, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6538384, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6539607, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6554065, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.656007, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.656411, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6568246, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6574981, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.658046, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6586986, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6601293, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6604528, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6605666, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.660676, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6607888, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6633012, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6634784, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.663651, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6638193, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6657825, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6669338, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.667558, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6677313, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6679, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6680691, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.668236, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6684158, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.672311, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6726837, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.673553, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6741695, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.674341, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6745098, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6746974, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6748595, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.675019, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.676157, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6764393, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6767166, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6769953, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6772618, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6775954, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6779387, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6782398, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6786191, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6796958, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6799607, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6808836, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.681628, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6825554, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6827343, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6829102, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.683085, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6832378, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6834085, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6838408, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6839795, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6841197, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6842592, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6844025, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6850517, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6862245, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6866293, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6868849, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6876686, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6883283, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.689186, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6893501, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6896842, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6900573, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.690226, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.690376, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6905205, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6907544, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6910367, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6911454, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6912532, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6917112, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6919236, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6921542, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6924877, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.69261, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6927388, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6928585, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6929762, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6933281, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6935027, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6937435, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.694104, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.694594, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6948977, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6952248, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6956432, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6963065, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6996932, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.699958, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7003212, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7009103, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.701581, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.702549, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7028372, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7029815, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7032852, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7036493, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7046568, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7064009, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.706741, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7071078, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7096508, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7135155, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.716165, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7166648, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7168746, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7172573, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.717908, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7183373, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7186425, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7190967, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.719244, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7193913, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.719538, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7203374, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.720586, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7207935, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7210286, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7212317, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7214298, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7216349, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7227685, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7245016, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7251437, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7260892, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7286103, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7290137, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7297556, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7305574, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7311115, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7315712, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7323735, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7333424, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7336397, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7342443, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.735132, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7355175, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7361603, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7369187, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7373786, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7375798, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7381556, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7386506, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7394593, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7401237, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7407687, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.741017, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7414882, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.741936, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7426405, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7430313, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7432854, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7449958, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.749319, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7536733, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7548, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7553203, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7556918, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.758484, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7601566, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.760957, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.762194, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7627451, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7631853, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.763874, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.764794, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7654161, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7657855, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7663717, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7671711, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.767655, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7679873, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7684238, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.768933, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7695575, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7701163, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7705212, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.770912, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7732036, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.774252, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7744417, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7749143, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7751918, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.775397, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7756586, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.775834, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7772977, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7782364, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7790759, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7800605, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7873495, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7901907, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7930305, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.793519, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.794108, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7943647, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7945757, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7947197, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.795063, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7955637, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7957592, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7959661, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7962224, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7963722, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7965717, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7974956, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7977483, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.797931, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7981102, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7983038, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7984827, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7986562, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7988267, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7990808, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7993014, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7995148, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8000298, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8007572, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8009584, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8011396, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.801316, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8015134, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8017101, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8019025, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8020937, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8023226, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.80283, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8031294, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8033895, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8036106, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8039904, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8041537, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8043156, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8044767, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8046887, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.804941, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.805226, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8078783, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8082688, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8088205, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8092952, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8101294, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.810665, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8108962, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8111959, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8116043, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8123815, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8126383, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8129423, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8132286, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8135288, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8138154, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8141007, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.814389, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8157916, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.816059, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8162637, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8165793, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.816822, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.817059, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8172817, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.817607, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8179195, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8205428, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8209214, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8212616, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.821868, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.822502, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8232868, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.823619, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8245041, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.824755, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8250299, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8252788, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8255324, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8257682, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8260329, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8262987, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8265893, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8270638, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8272448, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8274217, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.827562, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.827695, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8278294, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8280785, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8285356, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8288343, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8293881, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8296857, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8298824, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.830067, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8304837, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8310556, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8312254, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8315787, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8318348, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8320231, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8326375, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.832832, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.833221, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8335524, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8337526, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8340464, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8342876, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8353248, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8369775, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8377638, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.838205, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.838904, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8397834, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8403194, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8405514, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8412523, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8420458, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8428345, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.843129, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.843628, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8443375, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8453617, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8462815, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8469808, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8481612, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8490472, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.849945, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.850842, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8519106, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8525832, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8535957, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8546581, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8555791, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8564944, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8573883, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8587825, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8592777, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8611991, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.862366, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.863168, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.864245, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8648999, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.866509, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.868086, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8695564, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8716857, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8726864, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8733747, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8772132, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8780007, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8798225, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.884303, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8853831, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8857818, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8867238, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8871465, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8877168, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.889197, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8897512, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8901742, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8906307, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8913255, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.891688, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8929994, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8944106, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.896477, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8976533, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8984094, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.899877, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9008343, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9012654, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.902375, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9034317, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9041092, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.905452, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9066658, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9073968, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9081635, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9087164, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9099238, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.91023, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9112902, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9118235, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9123547, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9132106, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9143326, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9154823, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9157643, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9161975, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9166517, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9175994, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9183867, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9186335, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9196086, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.920096, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9230525, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9231713, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9279823, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9288132, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9294503, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9310899, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9315825, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9322493, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9333272, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9342287, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.935171, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9355078, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9368477, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9381762, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9386184, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9390438, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9394717, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9401152, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9403238, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.940531, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9407337, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9409614, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.94169, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.941847, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9419944, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9421463, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.942257, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9423363, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9424145, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.942631, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9429073, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9434783, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9437568, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9438877, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9439962, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.944433, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9445148, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9445941, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9446726, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.94475, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9449284, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9450083, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945088, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945167, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9452443, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945333, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9454203, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9469726, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9473388, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9478106, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9483526, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.948659, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9490118, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9493334, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.949706, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.950469, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9508486, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724265988.5199492, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0347483, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0359235, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0368972, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.038067, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0389752, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0396557, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0407424, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0424414, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0446754, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0453932, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0464694, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248307.4756505, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248307.4783177, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450315.8440773}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": []}, "group_map": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012236.143505, "config": {"enabled": true}, "primary_entity": null}}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v10.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T09:40:14.338540Z", "invocation_id": "05e959b9-6f4a-4e69-b3fe-525577e156e9", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449561.798907, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449561.8256264, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449561.8359013, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true}, "access": "public", "post-hook": [], "pre-hook": []}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449561.8604298, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4511847, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4553041, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "quote_columns": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.4595659, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9611962, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9593256, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.9548697, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.966592, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449561.962744, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0610158, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.054893, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.056103, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0568664, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0582566, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.0532146, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449562.059625, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7046132, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.725476, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7298582, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7338846, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.738564, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7425964, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449561.7466493, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.810583, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8118308, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449561.8130412, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8284585, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8295715, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449561.831007, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8365092, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8394988, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449561.8407967, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8631747, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8642366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8655326, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8666131, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449561.8712418, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8737586, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8748631, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8763008, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8775678, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.8787775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9675243, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9693432, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449561.9709876, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9789839, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9803555, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449561.9817505, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9854095, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9870067, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449561.988654, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9922721, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.994176, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449561.9954035, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449561.9989605, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.000157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1723449562.0017834, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449562.0035355, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0619245, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449562.063495, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0671086, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449562.0693965, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0738366, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449562.075331, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.078562, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449562.0796297, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.082224, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0835142, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449562.0845788, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0872235, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0884833, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449562.089618, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0921292, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449562.0934248, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449562.0945861, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450315.7829788, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450315.8168404, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450315.8190255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "access": "protected", "post-hook": [], "pre-hook": []}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136581.067327, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136581.0791683, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model"}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true}, "access": "public", "post-hook": [], "pre-hook": []}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602068.9390628, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9506948, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9519544, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602068.9532511, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "post-hook": [], "pre-hook": []}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381704.531615, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.504824, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.548347, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381704.5500321, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "dbt_pslattery", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "2337b7104659955eb2d350e6b0a09ba3bdc6c6836ab1b6aebaf91e2ec75c1e8f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false}, "strategy": "timestamp", "target_schema": "dbt_pslattery", "target_database": "dbt", "updated_at": "order_date", "check_cols": null, "post-hook": [], "pre-hook": []}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_database": "dbt", "target_schema": "dbt_pslattery", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727257210.02773, "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\"", "raw_code": "\n\n {{\n config(\n target_database='dbt' if target.type == 'duckdb' else 'padraic-slattery-sndbx-o',\n target_schema=\"dbt_pslattery\",\n unique_key=\"id\",\n strategy=\"timestamp\",\n updated_at=\"order_date\",\n )\n }}\n\n select *\n from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449562.097551}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449562.097694}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449562.0979037}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449562.098049}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449562.0982049}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449562.0985532}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449562.0987058}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450315.8490653}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450315.8492167}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450315.8493302}}, "macros": {"macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3907254, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3909812, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3913608, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.391663, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3920808, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.393275, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3934507, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3939273, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.394522, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.394881, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.395109, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3954344, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3957927, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3958757, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.396058, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3961682, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3963244, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.396564, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3968086, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3971038, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% for k in options %}\n {% if options[k] is string %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% else %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endif %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.398336, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n select\n '{{ database }}' as table_database,\n t.table_schema,\n t.table_name,\n t.table_type,\n '' as table_comment,\n c.column_name,\n c.ordinal_position as column_index,\n c.data_type column_type,\n '' as column_comment,\n '' as table_owner\n FROM information_schema.tables t JOIN information_schema.columns c ON t.table_schema = c.table_schema AND t.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(t.table_schema) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n AND t.table_type IN ('BASE TABLE', 'VIEW')\n ORDER BY\n t.table_schema,\n t.table_name,\n c.ordinal_position\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.3990405, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4002647, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4003937, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE)\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4023612, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4034038, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4052565, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.406209, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4066675, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4068289, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4099777, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.410223, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4107518, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4132404, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4138668, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4145193, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4146583, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4148679, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(True, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.statement", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4206395, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.425707, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4284923, "supported_languages": ["sql", "python"]}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.428782, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.428932, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4294407, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.429642, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4299147, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4301996, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4303281, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4307039, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4308925, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4311748, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4313195, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4316528, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4318244, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4320965, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.43224, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4324825, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4326136, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4334445, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4336145, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4337907, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.43396, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4341364, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4343011, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4345484, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4347372, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4349055, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4350626, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.435227, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4353755, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4355397, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4356894, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4360611, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4363134, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4365578, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4366677, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4369624, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4371088, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.437412, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4375758, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4379432, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4382255, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4383762, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4389386, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.439369, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4396837, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4398541, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.440095, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4402049, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4404325, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.440514, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4407272, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4408934, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.441165, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4413, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4415913, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4417448, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4419973, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.442115, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.44235, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4425137, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4427583, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4429224, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4434009, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4436817, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4439855, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4443707, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.444764, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4451437, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4454188, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.445772, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4461033, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4464297, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4474847, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.447692, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.447847, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4479995, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4481518, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4539795, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4544306, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.454728, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4578888, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4582074, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4583986, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4585047, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.458672, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.458804, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4590356, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4600732, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4602895, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4605792, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.461061, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4643033, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4644904, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4647477, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.465538, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4657273, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4659338, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4674535, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4690592, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4726355, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4764824, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4774618, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4777105, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4782274, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4784286, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4785738, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4787254, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.478848, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4790168, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.479142, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4796462, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4798412, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.48116, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_as_sql": {"name": "get_replace_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "unique_id": "macro.dbt.get_replace_materialized_view_as_sql", "macro_sql": "{% macro get_replace_materialized_view_as_sql(relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {{- log('Applying REPLACE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_replace_materialized_view_as_sql', 'dbt')(relation, sql, existing_relation, backup_relation, intermediate_relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4815974, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_as_sql": {"name": "default__get_replace_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/replace_materialized_view.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_as_sql", "macro_sql": "{% macro default__get_replace_materialized_view_as_sql(relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4817867, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4822607, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/alter_materialized_view.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.482463, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "original_file_path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4828763, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "original_file_path": "macros/materializations/models/materialized_view/get_materialized_view_configuration_changes.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4830303, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4833648, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/create_materialized_view.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4835317, "supported_languages": null}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4880648, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.488616, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4889224, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_materialized_view_as_sql(target_relation, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_materialized_view_as_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4904976, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.490772, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4915497, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4919055, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view/refresh_materialized_view.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4920633, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4927607, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.498466, "supported_languages": ["sql"]}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4993896, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4996479, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.4998527, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5001757, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5003862, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5007157, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5009205, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5011988, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5013986, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5015752, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5019002, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5064988, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5077899, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5091558, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5100772, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5115416, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5121188, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.512817, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5130568, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.513812, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5189037, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5206394, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5209143, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.522006, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.522284, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5229695, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.526083, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5263412, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5264661, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5267584, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.526902, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.527676, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5278707, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5283177, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.529037, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5295272, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5297506, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/create_table_as.sql", "original_file_path": "macros/materializations/models/table/create_table_as.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.529963, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/table.sql", "original_file_path": "macros/materializations/models/table/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5325866, "supported_languages": ["sql"]}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5335255, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.533656, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5342312, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5344043, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.534548, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.535914, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5363173, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table/columns_spec_ddl.sql", "original_file_path": "macros/materializations/models/table/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5366805, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5371044, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5372782, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5374854, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_view_as.sql", "original_file_path": "macros/materializations/models/view/create_view_as.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.537981, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/create_or_replace_view.sql", "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5394964, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/view.sql", "original_file_path": "macros/materializations/models/view/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.542119, "supported_languages": ["sql"]}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.54246, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view/helpers.sql", "original_file_path": "macros/materializations/models/view/helpers.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5427148, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5430717, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.543482, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5438955, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5442185, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.546299, "supported_languages": ["sql"]}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5470974, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {%- if relation.is_table -%}\n {{- drop_table(relation) -}}\n {%- elif relation.is_view -%}\n {{- drop_view(relation) -}}\n {%- elif relation.is_materialized_view -%}\n {{- drop_materialized_view(relation) -}}\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endif -%}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.drop_table", "macro.dbt.drop_view", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5475767, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{ return(adapter.dispatch('drop_table', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.547775, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5478892, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{ return(adapter.dispatch('drop_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5480773, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5484853, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{ return(adapter.dispatch('drop_materialized_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5486853, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/drop_relation.sql", "original_file_path": "macros/adapters/drop_relation.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5488043, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5494304, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5496182, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5498347, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.550014, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5502872, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5507913, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5526664, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.552844, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553187, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5534184, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553654, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.553873, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {{ col_err.append(col['name']) }}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n cast(null as {{ col['data_type'] }}) as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5547442, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5551102, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5552998, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5556712, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5559056, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5565345, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5568066, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5576742, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5581021, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.558321, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.558497, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5586948, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5610585, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.561244, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5614843, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5618138, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5620823, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5624301, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.562621, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5627966, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5630093, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5633154, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5635722, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.564142, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5643845, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5645375, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5647528, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.566168, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5664577, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5666516, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5668216, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5670176, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5672822, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5674984, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5678205, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5680122, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.568185, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5686388, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.568808, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5689707, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5691733, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5693545, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5694406, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5696318, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.569824, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5713298, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.571468, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5716598, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5717897, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.572199, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5724158, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5725393, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5727935, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5730069, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5732567, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.573466, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.573708, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.57443, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.574618, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5748768, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.575109, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5763047, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.576732, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.577167, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.577464, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5777276, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5785117, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5787394, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5789049, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5793424, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.57954, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.579691, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.579859, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5799944, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.581597, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.583009, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5838404, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.584117, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5857966, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5864527, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.586784, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5871148, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5874732, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5880592, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.588311, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5898674, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5900512, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5909657, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5914044, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5920343, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.592539, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5926201, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5931215, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.593371, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5937965, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.594122, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.598862, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.5996869, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6007578, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6017082, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6026156, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6037545, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6057758, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.606229, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6065898, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.606943, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6076198, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.617837, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.622924, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6232927, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6235204, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.623665, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.623861, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6242344, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.624703, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.624927, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6253629, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.625561, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6258297, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.629263, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6301389, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6335135, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6359384, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.638758, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6417975, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6429508, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6433537, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.646367, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6512556, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6520326, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6534178, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6537116, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6538384, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6539607, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6554065, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.656007, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.656411, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6568246, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6574981, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.658046, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6586986, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6601293, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6604528, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6605666, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.660676, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6607888, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6633012, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6634784, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.663651, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6638193, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6657825, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6669338, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.667558, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6677313, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6679, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6680691, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.668236, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6684158, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.672311, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6726837, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.673553, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6741695, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.674341, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6745098, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6746974, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6748595, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.675019, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.676157, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6764393, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6767166, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6769953, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6772618, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6775954, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6779387, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6782398, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6786191, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6796958, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6799607, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6808836, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.681628, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6825554, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6827343, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6829102, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.683085, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6832378, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6834085, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6838408, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6839795, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6841197, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6842592, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6844025, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6850517, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6862245, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6866293, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6868849, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6876686, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6883283, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.689186, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6893501, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6896842, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6900573, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.690226, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.690376, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6905205, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6907544, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6910367, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6911454, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6912532, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6917112, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6919236, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6921542, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6924877, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.69261, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6927388, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6928585, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6929762, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6933281, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6935027, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6937435, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.694104, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.694594, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6948977, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6952248, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6956432, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6963065, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.6996932, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.699958, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7003212, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7009103, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.701581, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.702549, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7028372, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7029815, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7032852, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7036493, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7046568, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7064009, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.706741, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7071078, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7096508, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7135155, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.716165, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7166648, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7168746, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7172573, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.717908, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7183373, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7186425, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7190967, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.719244, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7193913, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.719538, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7203374, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.720586, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7207935, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7210286, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7212317, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7214298, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7216349, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7227685, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7245016, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7251437, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7260892, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7286103, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7290137, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7297556, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7305574, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7311115, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7315712, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7323735, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7333424, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7336397, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7342443, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.735132, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7355175, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7361603, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7369187, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7373786, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7375798, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7381556, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7386506, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7394593, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7401237, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7407687, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.741017, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7414882, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.741936, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7426405, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7430313, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7432854, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7449958, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.749319, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7536733, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7548, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7553203, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7556918, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.758484, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7601566, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.760957, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.762194, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7627451, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7631853, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.763874, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.764794, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7654161, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7657855, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7663717, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7671711, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.767655, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7679873, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7684238, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.768933, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7695575, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7701163, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7705212, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.770912, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7732036, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.774252, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7744417, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7749143, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7751918, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.775397, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7756586, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.775834, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7772977, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7782364, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7790759, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7800605, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7873495, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7901907, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7930305, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.793519, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.794108, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7943647, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7945757, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7947197, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.795063, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7955637, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7957592, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7959661, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7962224, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7963722, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7965717, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7974956, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7977483, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.797931, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7981102, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7983038, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7984827, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7986562, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7988267, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7990808, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7993014, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.7995148, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8000298, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8007572, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8009584, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8011396, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.801316, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8015134, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8017101, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8019025, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8020937, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8023226, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.80283, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8031294, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8033895, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8036106, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8039904, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8041537, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8043156, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8044767, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8046887, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.804941, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.805226, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8078783, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8082688, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8088205, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8092952, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8101294, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.810665, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8108962, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8111959, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8116043, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8123815, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8126383, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8129423, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8132286, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8135288, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8138154, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8141007, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.814389, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8157916, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.816059, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8162637, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8165793, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.816822, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.817059, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8172817, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.817607, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8179195, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8205428, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8209214, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8212616, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.821868, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.822502, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8232868, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.823619, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8245041, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.824755, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8250299, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8252788, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8255324, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8257682, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8260329, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8262987, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8265893, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8270638, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8272448, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8274217, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.827562, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.827695, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8278294, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8280785, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8285356, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8288343, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8293881, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8296857, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8298824, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.830067, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8304837, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8310556, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8312254, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8315787, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8318348, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8320231, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8326375, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.832832, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.833221, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8335524, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8337526, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8340464, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8342876, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8353248, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8369775, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8377638, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.838205, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.838904, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8397834, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8403194, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8405514, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8412523, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8420458, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8428345, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.843129, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.843628, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8443375, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8453617, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8462815, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8469808, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8481612, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8490472, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.849945, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.850842, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8519106, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8525832, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8535957, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8546581, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8555791, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8564944, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8573883, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8587825, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8592777, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8611991, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.862366, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.863168, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.864245, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8648999, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.866509, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.868086, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8695564, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8716857, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8726864, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8733747, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8772132, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8780007, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8798225, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.884303, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8853831, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8857818, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8867238, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8871465, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8877168, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.889197, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8897512, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8901742, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8906307, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8913255, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.891688, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8929994, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8944106, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.896477, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8976533, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.8984094, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.899877, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9008343, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9012654, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.902375, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9034317, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9041092, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.905452, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9066658, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9073968, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9081635, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9087164, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9099238, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.91023, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9112902, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9118235, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9123547, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9132106, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9143326, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9154823, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9157643, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9161975, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9166517, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9175994, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9183867, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9186335, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9196086, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.920096, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9230525, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9231713, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9279823, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9288132, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9294503, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9310899, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9315825, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9322493, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9333272, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9342287, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.935171, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9355078, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9368477, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9381762, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9386184, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9390438, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9394717, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9401152, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9403238, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.940531, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9407337, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9409614, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.94169, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.941847, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9419944, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9421463, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.942257, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9423363, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9424145, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.942631, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9429073, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9434783, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9437568, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9438877, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9439962, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.944433, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9445148, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9445941, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9446726, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.94475, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9449284, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9450083, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945088, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945167, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9452443, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.945333, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9454203, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9469726, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9473388, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9478106, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9483526, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.948659, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9490118, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9493334, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.949706, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.950469, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449560.9508486, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724265988.5199492, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0347483, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0359235, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0368972, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.038067, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0389752, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0396557, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0407424, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0424414, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0446754, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0453932, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012236.0464694, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248307.4756505, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248307.4783177, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450315.8440773}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": []}, "group_map": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012236.143505, "config": {"enabled": true}, "primary_entity": null}}} diff --git a/tests/fixtures/dbt_16/target/run_results.json b/tests/fixtures/dbt_16/target/run_results.json index e7bbe81..9108c92 100644 --- a/tests/fixtures/dbt_16/target/run_results.json +++ b/tests/fixtures/dbt_16/target/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T07:11:53.157656Z", "invocation_id": "f3a1b3b9-7096-4484-a7d6-963ea52d78af", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.433788Z", "completed_at": "2024-09-25T07:11:52.439561Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.479415Z", "completed_at": "2024-09-25T07:11:52.479440Z"}], "thread_id": "Thread-4", "execution_time": 0.11788058280944824, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.441595Z", "completed_at": "2024-09-25T07:11:52.449027Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.485230Z", "completed_at": "2024-09-25T07:11:52.485257Z"}], "thread_id": "Thread-5", "execution_time": 0.12435173988342285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.452809Z", "completed_at": "2024-09-25T07:11:52.457826Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.487994Z", "completed_at": "2024-09-25T07:11:52.488022Z"}], "thread_id": "Thread-6", "execution_time": 0.1245417594909668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.423112Z", "completed_at": "2024-09-25T07:11:52.469307Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.498980Z", "completed_at": "2024-09-25T07:11:52.498994Z"}], "thread_id": "Thread-3", "execution_time": 0.13857197761535645, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.458381Z", "completed_at": "2024-09-25T07:11:52.481412Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.510370Z", "completed_at": "2024-09-25T07:11:52.510396Z"}], "thread_id": "Thread-7", "execution_time": 0.14549994468688965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.542895Z", "completed_at": "2024-09-25T07:11:52.690188Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.753633Z", "completed_at": "2024-09-25T07:11:52.753675Z"}], "thread_id": "Thread-8", "execution_time": 0.2612307071685791, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.713970Z", "completed_at": "2024-09-25T07:11:52.723246Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.755547Z", "completed_at": "2024-09-25T07:11:52.755567Z"}], "thread_id": "Thread-4", "execution_time": 0.18664050102233887, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.620521Z", "completed_at": "2024-09-25T07:11:52.725444Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.763968Z", "completed_at": "2024-09-25T07:11:52.763992Z"}], "thread_id": "Thread-1", "execution_time": 0.24739360809326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.631018Z", "completed_at": "2024-09-25T07:11:52.744748Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.772685Z", "completed_at": "2024-09-25T07:11:52.772708Z"}], "thread_id": "Thread-5", "execution_time": 0.25324153900146484, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.669592Z", "completed_at": "2024-09-25T07:11:52.746656Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.774379Z", "completed_at": "2024-09-25T07:11:52.774402Z"}], "thread_id": "Thread-6", "execution_time": 0.25101566314697266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.653921Z", "completed_at": "2024-09-25T07:11:52.748428Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.776236Z", "completed_at": "2024-09-25T07:11:52.776263Z"}], "thread_id": "Thread-2", "execution_time": 0.25591254234313965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.700515Z", "completed_at": "2024-09-25T07:11:52.751764Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.782014Z", "completed_at": "2024-09-25T07:11:52.782031Z"}], "thread_id": "Thread-3", "execution_time": 0.2249138355255127, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.727249Z", "completed_at": "2024-09-25T07:11:52.762040Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.796184Z", "completed_at": "2024-09-25T07:11:52.796208Z"}], "thread_id": "Thread-7", "execution_time": 0.19268369674682617, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.817635Z", "completed_at": "2024-09-25T07:11:52.838874Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.878007Z", "completed_at": "2024-09-25T07:11:52.878020Z"}], "thread_id": "Thread-8", "execution_time": 0.08936047554016113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.823727Z", "completed_at": "2024-09-25T07:11:52.846358Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.887874Z", "completed_at": "2024-09-25T07:11:52.887889Z"}], "thread_id": "Thread-4", "execution_time": 0.09367585182189941, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.839773Z", "completed_at": "2024-09-25T07:11:52.864221Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.892124Z", "completed_at": "2024-09-25T07:11:52.892132Z"}], "thread_id": "Thread-1", "execution_time": 0.09125161170959473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.854798Z", "completed_at": "2024-09-25T07:11:52.880635Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.904527Z", "completed_at": "2024-09-25T07:11:52.904540Z"}], "thread_id": "Thread-6", "execution_time": 0.08003473281860352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.847337Z", "completed_at": "2024-09-25T07:11:52.886679Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.905646Z", "completed_at": "2024-09-25T07:11:52.905658Z"}], "thread_id": "Thread-5", "execution_time": 0.1015784740447998, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.866803Z", "completed_at": "2024-09-25T07:11:52.890980Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.911225Z", "completed_at": "2024-09-25T07:11:52.911234Z"}], "thread_id": "Thread-2", "execution_time": 0.08431077003479004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.881767Z", "completed_at": "2024-09-25T07:11:52.897523Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.917742Z", "completed_at": "2024-09-25T07:11:52.917752Z"}], "thread_id": "Thread-3", "execution_time": 0.0802769660949707, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.873304Z", "completed_at": "2024-09-25T07:11:52.898650Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.918588Z", "completed_at": "2024-09-25T07:11:52.918606Z"}], "thread_id": "Thread-7", "execution_time": 0.09047245979309082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.937086Z", "completed_at": "2024-09-25T07:11:52.957105Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.979235Z", "completed_at": "2024-09-25T07:11:52.979285Z"}], "thread_id": "Thread-4", "execution_time": 0.077392578125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.928911Z", "completed_at": "2024-09-25T07:11:52.958320Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.980975Z", "completed_at": "2024-09-25T07:11:52.981002Z"}], "thread_id": "Thread-8", "execution_time": 0.08540582656860352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.947263Z", "completed_at": "2024-09-25T07:11:52.966959Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.992223Z", "completed_at": "2024-09-25T07:11:52.992251Z"}], "thread_id": "Thread-1", "execution_time": 0.07741260528564453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.960649Z", "completed_at": "2024-09-25T07:11:52.972892Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:52.997950Z", "completed_at": "2024-09-25T07:11:52.997956Z"}], "thread_id": "Thread-6", "execution_time": 0.06874275207519531, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.974728Z", "completed_at": "2024-09-25T07:11:52.996922Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.012458Z", "completed_at": "2024-09-25T07:11:53.012484Z"}], "thread_id": "Thread-5", "execution_time": 0.0655968189239502, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.986608Z", "completed_at": "2024-09-25T07:11:53.000239Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.016708Z", "completed_at": "2024-09-25T07:11:53.016722Z"}], "thread_id": "Thread-3", "execution_time": 0.06037569046020508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:52.982120Z", "completed_at": "2024-09-25T07:11:53.001501Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.020202Z", "completed_at": "2024-09-25T07:11:53.020212Z"}], "thread_id": "Thread-2", "execution_time": 0.06952071189880371, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.032142Z", "completed_at": "2024-09-25T07:11:53.060037Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.081573Z", "completed_at": "2024-09-25T07:11:53.081584Z"}], "thread_id": "Thread-7", "execution_time": 0.08472204208374023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.037160Z", "completed_at": "2024-09-25T07:11:53.062455Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.087294Z", "completed_at": "2024-09-25T07:11:53.087316Z"}], "thread_id": "Thread-4", "execution_time": 0.0851600170135498, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.043249Z", "completed_at": "2024-09-25T07:11:53.065423Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.093836Z", "completed_at": "2024-09-25T07:11:53.093863Z"}], "thread_id": "Thread-8", "execution_time": 0.0855705738067627, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.047404Z", "completed_at": "2024-09-25T07:11:53.067559Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.095265Z", "completed_at": "2024-09-25T07:11:53.095295Z"}], "thread_id": "Thread-1", "execution_time": 0.08731937408447266, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.055671Z", "completed_at": "2024-09-25T07:11:53.068697Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.097797Z", "completed_at": "2024-09-25T07:11:53.097810Z"}], "thread_id": "Thread-6", "execution_time": 0.08581304550170898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.074953Z", "completed_at": "2024-09-25T07:11:53.096366Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.116231Z", "completed_at": "2024-09-25T07:11:53.116240Z"}], "thread_id": "Thread-5", "execution_time": 0.06791067123413086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.082556Z", "completed_at": "2024-09-25T07:11:53.101874Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.120507Z", "completed_at": "2024-09-25T07:11:53.120520Z"}], "thread_id": "Thread-3", "execution_time": 0.06539344787597656, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.088875Z", "completed_at": "2024-09-25T07:11:53.104487Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.121390Z", "completed_at": "2024-09-25T07:11:53.121405Z"}], "thread_id": "Thread-2", "execution_time": 0.06365680694580078, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.129587Z", "completed_at": "2024-09-25T07:11:53.144208Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.145444Z", "completed_at": "2024-09-25T07:11:53.145463Z"}], "thread_id": "Thread-7", "execution_time": 0.02855372428894043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:11:53.137278Z", "completed_at": "2024-09-25T07:11:53.148042Z"}, {"name": "execute", "started_at": "2024-09-25T07:11:53.149630Z", "completed_at": "2024-09-25T07:11:53.149635Z"}], "thread_id": "Thread-4", "execution_time": 0.03154349327087402, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"}], "elapsed_time": 0.9989480972290039, "args": {"log_format_file": "debug", "defer": false, "log_path": "dbt_project/logs", "enable_legacy_logger": false, "send_anonymous_usage_stats": true, "profiles_dir": "dbt_project", "log_level": "info", "select": [], "quiet": false, "use_colors": true, "strict_mode": false, "use_colors_file": true, "print": true, "populate_cache": true, "exclude": [], "indirect_selection": "eager", "introspect": true, "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target", "log_file_max_bytes": 10485760, "log_level_file": "debug", "project_dir": "dbt_project", "static_parser": true, "macro_debugging": false, "which": "generate", "empty_catalog": false, "warn_error_options": {"include": [], "exclude": []}, "cache_selected_only": false, "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target", "printer_width": 80, "compile": true, "favor_state": false, "version_check": true, "log_format": "default", "write_json": true, "partial_parse": true, "vars": {}}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", "dbt_version": "1.6.0", "generated_at": "2024-09-25T09:40:15.239104Z", "invocation_id": "05e959b9-6f4a-4e69-b3fe-525577e156e9", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.634083Z", "completed_at": "2024-09-25T09:40:14.649760Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.678162Z", "completed_at": "2024-09-25T09:40:14.678203Z"}], "thread_id": "Thread-3", "execution_time": 0.06243419647216797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.651529Z", "completed_at": "2024-09-25T09:40:14.653799Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.679574Z", "completed_at": "2024-09-25T09:40:14.679592Z"}], "thread_id": "Thread-4", "execution_time": 0.058225393295288086, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.664722Z", "completed_at": "2024-09-25T09:40:14.667777Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.689512Z", "completed_at": "2024-09-25T09:40:14.689520Z"}], "thread_id": "Thread-5", "execution_time": 0.09259629249572754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.669685Z", "completed_at": "2024-09-25T09:40:14.671888Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.701098Z", "completed_at": "2024-09-25T09:40:14.701126Z"}], "thread_id": "Thread-6", "execution_time": 0.09222269058227539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.675522Z", "completed_at": "2024-09-25T09:40:14.702261Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.752442Z", "completed_at": "2024-09-25T09:40:14.752454Z"}], "thread_id": "Thread-7", "execution_time": 0.11375904083251953, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.708437Z", "completed_at": "2024-09-25T09:40:14.744211Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.763881Z", "completed_at": "2024-09-25T09:40:14.763903Z"}], "thread_id": "Thread-2", "execution_time": 0.11282658576965332, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.690373Z", "completed_at": "2024-09-25T09:40:14.746646Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.774368Z", "completed_at": "2024-09-25T09:40:14.774403Z"}], "thread_id": "Thread-8", "execution_time": 0.11941289901733398, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.727240Z", "completed_at": "2024-09-25T09:40:14.749418Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.776314Z", "completed_at": "2024-09-25T09:40:14.776343Z"}], "thread_id": "Thread-1", "execution_time": 0.1243898868560791, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.764803Z", "completed_at": "2024-09-25T09:40:14.789036Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.821541Z", "completed_at": "2024-09-25T09:40:14.821567Z"}], "thread_id": "Thread-3", "execution_time": 0.09072566032409668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.779640Z", "completed_at": "2024-09-25T09:40:14.808611Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.833508Z", "completed_at": "2024-09-25T09:40:14.833523Z"}], "thread_id": "Thread-4", "execution_time": 0.10078597068786621, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.799703Z", "completed_at": "2024-09-25T09:40:14.818260Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.850607Z", "completed_at": "2024-09-25T09:40:14.850629Z"}], "thread_id": "Thread-6", "execution_time": 0.09914994239807129, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.790527Z", "completed_at": "2024-09-25T09:40:14.820448Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.855105Z", "completed_at": "2024-09-25T09:40:14.855122Z"}], "thread_id": "Thread-5", "execution_time": 0.10637640953063965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.837633Z", "completed_at": "2024-09-25T09:40:14.843122Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.865405Z", "completed_at": "2024-09-25T09:40:14.865427Z"}], "thread_id": "Thread-2", "execution_time": 0.056160688400268555, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.822625Z", "completed_at": "2024-09-25T09:40:14.852218Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.867464Z", "completed_at": "2024-09-25T09:40:14.867477Z"}], "thread_id": "Thread-7", "execution_time": 0.0714714527130127, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.844123Z", "completed_at": "2024-09-25T09:40:14.862847Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.876640Z", "completed_at": "2024-09-25T09:40:14.876661Z"}], "thread_id": "Thread-8", "execution_time": 0.06632351875305176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.900093Z", "completed_at": "2024-09-25T09:40:14.918412Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.965915Z", "completed_at": "2024-09-25T09:40:14.965950Z"}], "thread_id": "Thread-3", "execution_time": 0.10350561141967773, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.891906Z", "completed_at": "2024-09-25T09:40:14.919327Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.967190Z", "completed_at": "2024-09-25T09:40:14.967206Z"}], "thread_id": "Thread-1", "execution_time": 0.1084132194519043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.924237Z", "completed_at": "2024-09-25T09:40:14.963910Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.988859Z", "completed_at": "2024-09-25T09:40:14.988889Z"}], "thread_id": "Thread-6", "execution_time": 0.09278297424316406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.934483Z", "completed_at": "2024-09-25T09:40:14.965142Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:14.991975Z", "completed_at": "2024-09-25T09:40:14.991984Z"}], "thread_id": "Thread-8", "execution_time": 0.09548711776733398, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.951858Z", "completed_at": "2024-09-25T09:40:14.982537Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.001830Z", "completed_at": "2024-09-25T09:40:15.001856Z"}], "thread_id": "Thread-5", "execution_time": 0.09988069534301758, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.959240Z", "completed_at": "2024-09-25T09:40:14.985370Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.005939Z", "completed_at": "2024-09-25T09:40:15.005968Z"}], "thread_id": "Thread-2", "execution_time": 0.09868144989013672, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.968354Z", "completed_at": "2024-09-25T09:40:14.990326Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.009484Z", "completed_at": "2024-09-25T09:40:15.009501Z"}], "thread_id": "Thread-7", "execution_time": 0.0985713005065918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:14.974398Z", "completed_at": "2024-09-25T09:40:14.992736Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.013329Z", "completed_at": "2024-09-25T09:40:15.013343Z"}], "thread_id": "Thread-4", "execution_time": 0.09833955764770508, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.029113Z", "completed_at": "2024-09-25T09:40:15.042618Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.061533Z", "completed_at": "2024-09-25T09:40:15.061553Z"}], "thread_id": "Thread-1", "execution_time": 0.08053731918334961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.022710Z", "completed_at": "2024-09-25T09:40:15.050293Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.080636Z", "completed_at": "2024-09-25T09:40:15.080654Z"}], "thread_id": "Thread-3", "execution_time": 0.0955042839050293, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.065215Z", "completed_at": "2024-09-25T09:40:15.098433Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.118211Z", "completed_at": "2024-09-25T09:40:15.118227Z"}], "thread_id": "Thread-6", "execution_time": 0.07941627502441406, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.070371Z", "completed_at": "2024-09-25T09:40:15.101152Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.120303Z", "completed_at": "2024-09-25T09:40:15.120319Z"}], "thread_id": "Thread-8", "execution_time": 0.08040952682495117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.075500Z", "completed_at": "2024-09-25T09:40:15.102222Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.121122Z", "completed_at": "2024-09-25T09:40:15.121128Z"}], "thread_id": "Thread-4", "execution_time": 0.08040142059326172, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.081794Z", "completed_at": "2024-09-25T09:40:15.106680Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.123723Z", "completed_at": "2024-09-25T09:40:15.123731Z"}], "thread_id": "Thread-2", "execution_time": 0.0865480899810791, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.088787Z", "completed_at": "2024-09-25T09:40:15.107822Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.124592Z", "completed_at": "2024-09-25T09:40:15.124615Z"}], "thread_id": "Thread-7", "execution_time": 0.08550477027893066, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.093279Z", "completed_at": "2024-09-25T09:40:15.113974Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.130597Z", "completed_at": "2024-09-25T09:40:15.130608Z"}], "thread_id": "Thread-5", "execution_time": 0.09621572494506836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.131561Z", "completed_at": "2024-09-25T09:40:15.153965Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.172143Z", "completed_at": "2024-09-25T09:40:15.172161Z"}], "thread_id": "Thread-1", "execution_time": 0.07591557502746582, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.142446Z", "completed_at": "2024-09-25T09:40:15.163089Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.189363Z", "completed_at": "2024-09-25T09:40:15.189398Z"}], "thread_id": "Thread-3", "execution_time": 0.0877084732055664, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.175315Z", "completed_at": "2024-09-25T09:40:15.204028Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.216601Z", "completed_at": "2024-09-25T09:40:15.216636Z"}], "thread_id": "Thread-6", "execution_time": 0.0639183521270752, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.184439Z", "completed_at": "2024-09-25T09:40:15.205060Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.217609Z", "completed_at": "2024-09-25T09:40:15.217629Z"}], "thread_id": "Thread-4", "execution_time": 0.061064958572387695, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.180150Z", "completed_at": "2024-09-25T09:40:15.205760Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.218481Z", "completed_at": "2024-09-25T09:40:15.218487Z"}], "thread_id": "Thread-8", "execution_time": 0.06353521347045898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.199828Z", "completed_at": "2024-09-25T09:40:15.209726Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.219190Z", "completed_at": "2024-09-25T09:40:15.219210Z"}], "thread_id": "Thread-7", "execution_time": 0.05811595916748047, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:15.192174Z", "completed_at": "2024-09-25T09:40:15.210511Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:15.220463Z", "completed_at": "2024-09-25T09:40:15.220479Z"}], "thread_id": "Thread-2", "execution_time": 0.06050372123718262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2"}], "elapsed_time": 0.7947506904602051, "args": {"indirect_selection": "eager", "printer_width": 80, "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target", "compile": true, "use_colors_file": true, "use_colors": true, "log_level_file": "debug", "static_parser": true, "cache_selected_only": false, "macro_debugging": false, "enable_legacy_logger": false, "introspect": true, "profiles_dir": "dbt_project", "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_16/target", "vars": {}, "log_file_max_bytes": 10485760, "select": [], "print": true, "favor_state": false, "version_check": true, "partial_parse": true, "log_path": "dbt_project/logs", "populate_cache": true, "log_level": "info", "write_json": true, "defer": false, "log_format_file": "debug", "project_dir": "dbt_project", "strict_mode": false, "exclude": [], "empty_catalog": false, "quiet": false, "log_format": "default", "send_anonymous_usage_stats": true, "which": "generate", "warn_error_options": {"include": [], "exclude": []}}} diff --git a/tests/fixtures/dbt_17/target/catalog.json b/tests/fixtures/dbt_17/target/catalog.json index d347c80..d86ecaf 100644 --- a/tests/fixtures/dbt_17/target/catalog.json +++ b/tests/fixtures/dbt_17/target/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T07:12:35.250593Z", "invocation_id": "745125d0-5ac5-45a0-a498-db2b032d2c88", "env": {}}, "nodes": {"model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "snapshots", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}}, "sources": {}, "errors": null} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T09:40:34.783851Z", "invocation_id": "504619b0-99f2-43c4-8cc1-5a5e60e1c6e4", "env": {}}, "nodes": {"snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "dbt_pslattery", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}, "model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}}, "sources": {}, "errors": null} diff --git a/tests/fixtures/dbt_17/target/manifest.json b/tests/fixtures/dbt_17/target/manifest.json index 1e66a23..c62780f 100644 --- a/tests/fixtures/dbt_17/target/manifest.json +++ b/tests/fixtures/dbt_17/target/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v11.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T07:12:33.621641Z", "invocation_id": "745125d0-5ac5-45a0-a498-db2b032d2c88", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449578.7810388, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449578.8470948, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449578.856963, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449578.8863652, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.389641, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.391119, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.3925526, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9209101, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9198012, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9170935, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.924411, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.921798, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449579.0018299, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9970176, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9978616, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9984028, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.999594, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.99583, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449579.0007281, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.5845814, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6051936, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6093154, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6132317, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6178668, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6218882, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.625883, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8321593, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.833357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449578.8345385, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8499272, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8509758, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449578.8520222, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8575072, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8606312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449578.8616636, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8888893, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8899145, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.890928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.892193, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449578.8965647, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8992288, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9002228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9012299, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.902228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9034352, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9249356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9260688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449578.927091, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9328535, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9339705, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449578.9350183, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9377413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9387417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449578.9397714, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9425123, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9435356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449578.9445832, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9473362, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9484055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1723449578.949891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449578.95137, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0025425, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449579.0038793, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0069225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449579.007974, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0109482, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449579.0121303, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0154757, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449579.0168564, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0201628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0217655, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449579.0230215, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0263796, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0284514, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449579.0298097, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0331652, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0347068, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449579.0359735, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450331.6233761, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450331.6768863, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450331.6782959, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136600.0099175, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136600.0703266, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model"}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602084.531945, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5850985, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5863566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5875258, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381743.3512335, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.2984965, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.4028354, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.4044724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "snapshots", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "66c7297a2e7bafae8b9569abeee9f364001518a84ee37f26c722b00dcb9b3d3f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "snapshots", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_database": "dbt", "target_schema": "snapshots", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727248349.1961937, "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\"", "raw_code": "\n\n{{\n config(\n target_database='dbt',\n target_schema='snapshots',\n unique_key='id',\n\n strategy='timestamp',\n updated_at='order_date',\n )\n}}\n\nselect * from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449579.043002}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449579.0431805}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449579.0434413}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449579.04362}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449579.0438428}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449579.0444043}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449579.0446074}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450331.7402735}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450331.7404191}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450331.7405238}}, "macros": {"macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.255826, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.256034, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2563455, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2566166, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2570398, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2583299, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2585113, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.258946, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2594628, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2598162, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2600393, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2603679, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2607617, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2608547, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.261061, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2611825, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.261355, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2616196, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2618845, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format, config) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format, config) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2622085, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% if options is not mapping %}\n {% do exceptions.raise_compiler_error(\"The options argument must be a dictionary\") %}\n {% endif %}\n\n {% for k in options %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2632835, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n select\n '{{ database }}' as table_database,\n t.table_schema,\n t.table_name,\n t.table_type,\n '' as table_comment,\n c.column_name,\n c.ordinal_position as column_index,\n c.data_type column_type,\n '' as column_comment,\n '' as table_owner\n FROM information_schema.tables t JOIN information_schema.columns c ON t.table_schema = c.table_schema AND t.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(t.table_schema) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n AND t.table_type IN ('BASE TABLE', 'VIEW')\n ORDER BY\n t.table_schema,\n t.table_name,\n c.ordinal_position\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2639818, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.265553, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2656946, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2676508, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2686522, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2707613, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2716084, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2720635, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2722292, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.27521, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.275431, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2759202, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2785149, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.279104, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2797823, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2799454, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2801867, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(True, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.statement", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2861645, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2912052, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.293971, "supported_languages": ["sql", "python"]}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2942574, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.294404, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2948704, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2950463, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2953107, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2955942, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2957249, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.296093, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.296272, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2965498, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2966914, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2970128, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2971823, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2974591, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2976005, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2978446, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2979794, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2988315, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2989953, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2991688, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2993286, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2995021, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2996607, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2999122, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3001037, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3002818, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3004503, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3006263, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.300788, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3009646, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.301122, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3015018, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3017719, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3020272, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3021443, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3024306, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3025756, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.302863, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3030086, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3033433, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3036182, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.303771, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3043468, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3048003, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3051398, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.305333, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.305609, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3057368, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3059795, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3060653, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3062925, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3064578, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3067424, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3068848, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3071744, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3073275, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3075814, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3076954, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3079412, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.308117, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.308858, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.309319, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.309518, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3100922, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3107653, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.311401, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3116465, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3120356, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3123019, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.312474, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.312976, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3132765, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3136058, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3140256, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3144302, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.314806, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3150754, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3154275, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3158433, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.316177, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3172612, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.317472, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3176284, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3177848, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.317942, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3236537, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3241053, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3244145, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3276885, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3280184, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.328224, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3283374, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3285172, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3286533, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3288987, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3299463, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.330176, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3304627, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3309138, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.334565, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.334746, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3349926, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3357315, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3361166, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3363218, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3379133, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3392613, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3425508, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3465805, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3476915, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.347966, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3484807, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3486757, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3488169, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3489625, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.349082, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3492448, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3493798, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3499262, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3501256, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3514352, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3543108, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3587515, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3592093, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.359475, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.397922, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3982122, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.398913, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4017677, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4024236, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.407201, "supported_languages": ["sql"]}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4080162, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4082587, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.408452, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4087486, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4089415, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4092388, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4094315, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.409702, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4098928, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4100485, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.410333, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4148571, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4163275, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4177165, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4186256, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4200552, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4206493, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4214, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4216564, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.422457, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4274378, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4292383, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4295192, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4306264, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4309082, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4316115, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4353628, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.435652, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4357908, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4360912, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.436237, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4365973, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4370131, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.437438, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4377654, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.440531, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4412029, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4414015, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.441632, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.441825, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4421105, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4426107, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.444546, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4447255, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4450717, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4453132, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4455454, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4457436, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n cast(null as {{ col['data_type'] }}) as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.447009, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4473774, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4475718, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.447945, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.44818, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4488199, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4490886, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4499803, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4503703, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.450578, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4507465, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.45094, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4526234, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.452899, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4531407, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4535246, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4538486, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4543378, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4545531, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4547539, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.455047, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4556139, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.455841, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4559844, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4564939, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4566948, "supported_languages": null}, "macro.dbt.default__get_limit_subquery_sql": {"name": "default__get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_subquery_sql", "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.456845, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4593306, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4596167, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.45983, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4601114, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4603086, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4604857, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4606795, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4609473, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.46116, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4614787, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4616685, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4618373, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4620118, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4622598, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.462482, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.462667, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4631398, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.463302, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4634545, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4635706, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.463748, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4638321, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.464009, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4641879, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4656916, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4658177, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4659998, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4661214, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4665008, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4666986, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4668124, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4670532, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4672596, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4675035, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4677095, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.467951, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4686735, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4688718, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4691408, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4694126, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4710264, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4714916, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.471962, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4722736, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4725268, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4734604, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4736521, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4738564, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4743454, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4745574, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.474717, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4748862, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4750164, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4765668, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.477895, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4786954, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4789379, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4803858, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.481003, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4813228, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4816585, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4820218, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4826028, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4828494, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4831684, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4833887, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4841096, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.48604, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4864874, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4868119, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4873254, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.487869, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4881852, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.488403, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4890566, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4894652, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.489686, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4899197, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4901423, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4908202, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.491286, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4914975, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4917943, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.492158, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4924471, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4939482, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4940782, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494666, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494841, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494982, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4963996, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4967978, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4972138, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.497574, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4977288, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4980211, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4981887, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4984853, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4986522, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{ return(adapter.dispatch('drop_materialized_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4989386, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4990578, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4993184, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4994693, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5001166, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5003486, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5006623, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5008285, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.501111, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5012784, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5020757, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5022664, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.502717, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.503441, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5039155, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5041127, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.504302, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{ return(adapter.dispatch('drop_table', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5045707, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5046806, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5049472, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.505205, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.506002, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5061529, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5073125, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5075188, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5077536, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5081522, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5083194, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.508509, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5089655, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{ return(adapter.dispatch('drop_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5092273, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.509347, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5096333, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5097988, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5111847, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5113523, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5122662, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5127149, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5133762, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.51391, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5140016, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5145123, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5147674, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5150764, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.515373, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5200992, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5208704, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5218837, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5226972, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.523524, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.52452, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5261784, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5265427, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5268352, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5271258, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.527716, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.534326, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5371664, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5373874, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5375335, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5376203, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5377383, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.53796, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5382853, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5385027, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5388627, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5390272, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5392506, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5425086, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.543395, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5465684, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5486617, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5510187, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5539088, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5551991, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5556056, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5585947, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5635045, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5642753, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5655823, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5658462, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5659597, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5660694, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5675666, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5681944, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5686183, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5690389, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5696428, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5701103, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5707417, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5722127, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5725346, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5726495, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5727627, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5728788, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.575372, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5755544, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5757294, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5759, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5780642, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5792766, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.579934, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5801167, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5802941, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.580472, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5806487, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5808432, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5848975, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5852907, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.586161, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5867047, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5868776, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.587049, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5872371, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5874052, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5875719, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5887566, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5890377, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5893145, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5895882, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.589858, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5901556, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5904613, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5907364, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.591145, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5922794, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5925586, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5935302, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.594265, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5950968, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5952818, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5954642, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5956492, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.595811, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5959911, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5964851, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5966487, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.596819, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5969815, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5971563, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5978396, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5989454, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5993629, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5996263, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6004553, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6011596, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6020339, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6021883, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.602497, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.602807, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6029499, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6030903, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6032317, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6034584, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6037307, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.603846, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6039577, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604445, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604669, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604918, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6052604, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6053824, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6055088, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6056223, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6057343, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6060684, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6062276, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6064444, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.606791, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6073132, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6076322, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6079805, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6084142, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6091926, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6125169, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6127903, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.613194, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6138375, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.614465, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.615379, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.615669, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6158142, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6161227, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6164942, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6175458, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6191769, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.619529, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6199052, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6225386, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6263828, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6290317, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6295319, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6297386, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.630116, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6307166, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6311295, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6314373, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.631912, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6320658, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6322157, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6323626, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6331723, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6334157, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6336021, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6338177, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6340046, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6341915, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.634382, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6354785, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6371627, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6378825, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.638804, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.641438, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6419206, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6426837, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.64347, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6440277, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6444867, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.645305, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6463099, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6466045, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6472042, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6480844, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6484706, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6491208, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6499507, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.650426, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6506236, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.651182, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6516619, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.652447, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6530967, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6537426, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.654092, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6544883, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6549392, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6556826, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6561031, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.656359, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6581447, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6624172, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6668148, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6679616, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6684742, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.668843, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6716087, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6732812, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6740654, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.675253, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6757865, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.676211, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6768825, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.677823, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6784434, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.67881, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.67939, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6801934, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6806834, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6810224, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6814587, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6819637, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.682548, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6830628, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6834679, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6838672, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6862533, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.687169, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.687351, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6878142, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6881015, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6883116, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6885767, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6887534, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6902397, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.691052, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.691792, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6926918, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6996887, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7021585, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7046874, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7050817, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7055676, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7057788, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.705956, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.706071, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.706341, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7067366, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7068856, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7070363, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7072327, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7073457, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.707495, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7081776, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7083855, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.708536, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7086852, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.708846, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7090023, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7091582, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7093089, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7095282, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7097244, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7099123, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7103822, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7110858, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7112832, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7114577, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.711634, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7118077, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7119904, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7121646, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.712336, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7125447, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7130158, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7132938, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7135353, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.713739, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7141073, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7142665, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7144196, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7145884, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.714789, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7150235, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7153268, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7177646, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7181182, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7186062, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7189662, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.719576, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7200146, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7202086, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7204626, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7208142, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7215586, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7218008, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7220445, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722284, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7225304, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722752, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722984, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7232156, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7244792, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.724724, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7249157, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7252154, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7254438, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7256732, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7258768, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.726155, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7264216, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7286198, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7288992, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7291834, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.729766, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.730309, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7309673, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7312453, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7319753, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7321808, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7323937, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7325985, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7328115, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7330074, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7332127, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7334166, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.733636, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7340186, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7341645, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7343087, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7344184, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.734528, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7346368, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7348373, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7352014, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7354374, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7358725, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7360942, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7362416, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.73639, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7367754, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7373083, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.737464, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.737931, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7381692, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7383242, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7388263, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7389858, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.739286, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7395456, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7396924, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7399056, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.740082, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7409, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.742336, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7429755, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7433035, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7438717, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7446074, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7450614, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7452736, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7458706, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7465248, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7471585, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7473993, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7477853, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7483766, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7492704, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.750048, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7506292, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.751605, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7523544, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.753097, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.753892, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7547834, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7553558, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7562356, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.757056, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7579021, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.758664, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7594085, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7605736, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7609818, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7625272, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7633734, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7640536, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7650406, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7656548, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7669747, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7683365, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7696702, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7718265, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7727106, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7733762, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.777071, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7777488, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7795248, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7841926, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7853687, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7857823, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7867718, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7872183, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7877665, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7890744, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.789586, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7900224, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7904615, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7911181, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7914238, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7926502, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7939343, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7959137, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7970212, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7977076, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7990885, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7999501, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.800309, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8012693, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.802363, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.803096, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8044257, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.805517, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.806238, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8069174, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8074107, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8084247, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8086836, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8096614, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8101683, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8106477, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8113558, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8122814, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8133647, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.813623, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8140223, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8144488, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8153, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8160288, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.816262, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8171616, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8176754, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8204968, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8206196, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.825, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.825804, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8263352, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8276882, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8281374, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8287835, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8299263, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8307276, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8315558, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8318574, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8325183, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8330867, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8333359, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8335903, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.833848, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.834212, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8343337, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8344471, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8345587, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.83467, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8349922, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8350768, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835159, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8352547, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8353367, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8354166, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835496, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8356895, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835969, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8363254, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.836601, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8367324, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.836844, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8372827, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8373632, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8374429, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.83753, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8376145, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8377979, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.837885, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.837969, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8380554, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8381393, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.838224, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.838306, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8398614, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8402214, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8407, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8412597, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8415964, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8419602, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.842266, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8425782, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8432724, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8436368, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724266007.243057, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.974958, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9763288, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9778385, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9791083, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9799974, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.981989, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9848895, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9862425, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9875321, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9883466, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9897618, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248349.1093776, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248349.1112146, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450331.6935074}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012255.364933, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v11.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T09:40:33.032292Z", "invocation_id": "504619b0-99f2-43c4-8cc1-5a5e60e1c6e4", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449578.7810388, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449578.8470948, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449578.856963, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449578.8863652, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.389641, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.391119, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.3925526, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9209101, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9198012, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.9170935, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.924411, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449578.921798, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449579.0018299, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9970176, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9978616, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.9984028, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.999594, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.99583, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "deferred": false, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449579.0007281, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.5845814, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6051936, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6093154, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6132317, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6178668, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.6218882, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449578.625883, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8321593, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.833357, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449578.8345385, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments"}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8499272, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8509758, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449578.8520222, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders"}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8575072, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8606312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449578.8616636, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1"}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8888893, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8899145, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.890928, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.892193, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449578.8965647, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.8992288, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9002228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9012299, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.902228, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9034352, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9249356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9260688, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449578.927091, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9328535, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9339705, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449578.9350183, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9377413, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9387417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449578.9397714, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9425123, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9435356, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449578.9445832, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9473362, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449578.9484055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true}, "created_at": 1723449578.949891, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449578.95137, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0025425, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449579.0038793, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0069225, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449579.007974, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0109482, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449579.0121303, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0154757, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449579.0168564, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0201628, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0217655, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449579.0230215, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0263796, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0284514, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449579.0298097, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0331652, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723449579.0347068, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449579.0359735, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450331.6233761, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450331.6768863, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1723450331.6782959, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136600.0099175, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136600.0703266, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model"}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602084.531945, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5850985, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5863566, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1724602084.5875258, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "deferred": false, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381743.3512335, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.2984965, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.4028354, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}, "database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {}, "created_at": 1725381743.4044724, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "dbt_pslattery", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "2337b7104659955eb2d350e6b0a09ba3bdc6c6836ab1b6aebaf91e2ec75c1e8f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "dbt_pslattery", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "deferred": false, "unrendered_config": {"target_database": "dbt", "target_schema": "dbt_pslattery", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727257228.616057, "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\"", "raw_code": "\n\n {{\n config(\n target_database='dbt' if target.type == 'duckdb' else 'padraic-slattery-sndbx-o',\n target_schema=\"dbt_pslattery\",\n unique_key=\"id\",\n strategy=\"timestamp\",\n updated_at=\"order_date\",\n )\n }}\n\n select *\n from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449579.043002}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449579.0431805}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449579.0434413}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449579.04362}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449579.0438428}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449579.0444043}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449579.0446074}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450331.7402735}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450331.7404191}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450331.7405238}}, "macros": {"macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.255826, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.256034, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2563455, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2566166, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2570398, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2583299, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2585113, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.258946, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2594628, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2598162, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2600393, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2603679, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2607617, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2608547, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.261061, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2611825, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.261355, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2616196, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2618845, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format, config) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format, config) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2622085, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% if options is not mapping %}\n {% do exceptions.raise_compiler_error(\"The options argument must be a dictionary\") %}\n {% endif %}\n\n {% for k in options %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2632835, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n select\n '{{ database }}' as table_database,\n t.table_schema,\n t.table_name,\n t.table_type,\n '' as table_comment,\n c.column_name,\n c.ordinal_position as column_index,\n c.data_type column_type,\n '' as column_comment,\n '' as table_owner\n FROM information_schema.tables t JOIN information_schema.columns c ON t.table_schema = c.table_schema AND t.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(t.table_schema) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n AND t.table_type IN ('BASE TABLE', 'VIEW')\n ORDER BY\n t.table_schema,\n t.table_name,\n c.ordinal_position\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2639818, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.265553, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2656946, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2676508, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2686522, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2707613, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2716084, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2720635, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2722292, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.27521, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.275431, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2759202, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2785149, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.279104, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2797823, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2799454, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2801867, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(True, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.statement", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2861645, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2912052, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.293971, "supported_languages": ["sql", "python"]}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2942574, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.294404, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2948704, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2950463, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2953107, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2955942, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2957249, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.296093, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.296272, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2965498, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2966914, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2970128, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2971823, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2974591, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2976005, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2978446, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2979794, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2988315, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2989953, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2991688, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2993286, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2995021, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2996607, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.2999122, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3001037, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3002818, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3004503, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3006263, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.300788, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3009646, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.301122, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3015018, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3017719, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3020272, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3021443, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3024306, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3025756, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.302863, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3030086, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3033433, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3036182, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.303771, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3043468, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3048003, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3051398, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.305333, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.305609, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3057368, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3059795, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3060653, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3062925, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3064578, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3067424, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3068848, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3071744, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3073275, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3075814, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3076954, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3079412, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.308117, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.308858, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.309319, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.309518, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3100922, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3107653, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.311401, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3116465, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3120356, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3123019, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.312474, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.312976, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3132765, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3136058, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3140256, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3144302, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.314806, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3150754, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3154275, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3158433, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.316177, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3172612, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.317472, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3176284, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3177848, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.317942, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3236537, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3241053, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3244145, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3276885, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3280184, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.328224, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3283374, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3285172, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3286533, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3288987, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3299463, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.330176, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3304627, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3309138, "supported_languages": null}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.334565, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.334746, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3349926, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3357315, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3361166, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3363218, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3379133, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3392613, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3425508, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3465805, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3476915, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.347966, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3484807, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3486757, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3488169, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3489625, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.349082, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3492448, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3493798, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3499262, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3501256, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3514352, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3543108, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3587515, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3592093, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.359475, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.397922, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.3982122, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.398913, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4017677, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4024236, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.407201, "supported_languages": ["sql"]}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4080162, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4082587, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.408452, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4087486, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4089415, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4092388, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4094315, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.409702, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4098928, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4100485, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.410333, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4148571, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4163275, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4177165, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4186256, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4200552, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4206493, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4214, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4216564, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.422457, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4274378, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4292383, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4295192, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4306264, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4309082, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4316115, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4353628, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.435652, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4357908, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4360912, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.436237, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4365973, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4370131, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.437438, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4377654, "supported_languages": null}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.440531, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4412029, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4414015, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.441632, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.441825, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4421105, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4426107, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.444546, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4447255, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4450717, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4453132, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4455454, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4457436, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n cast(null as {{ col['data_type'] }}) as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.447009, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4473774, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4475718, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.447945, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.44818, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4488199, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4490886, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4499803, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4503703, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.450578, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4507465, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.45094, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4526234, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.452899, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4531407, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4535246, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4538486, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4543378, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4545531, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4547539, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.455047, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4556139, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.455841, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4559844, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4564939, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4566948, "supported_languages": null}, "macro.dbt.default__get_limit_subquery_sql": {"name": "default__get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_subquery_sql", "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.456845, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4593306, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4596167, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.45983, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4601114, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4603086, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4604857, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4606795, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4609473, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.46116, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4614787, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4616685, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4618373, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4620118, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4622598, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.462482, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.462667, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4631398, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.463302, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4634545, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4635706, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.463748, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4638321, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.464009, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4641879, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4656916, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4658177, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4659998, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4661214, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4665008, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4666986, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4668124, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4670532, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4672596, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4675035, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4677095, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.467951, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4686735, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4688718, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4691408, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4694126, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4710264, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4714916, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.471962, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4722736, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4725268, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4734604, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4736521, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4738564, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4743454, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4745574, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.474717, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4748862, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4750164, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4765668, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.477895, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4786954, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4789379, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4803858, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.481003, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4813228, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4816585, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4820218, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4826028, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4828494, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4831684, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4833887, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4841096, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.48604, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4864874, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4868119, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4873254, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.487869, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4881852, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.488403, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4890566, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4894652, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.489686, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4899197, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4901423, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4908202, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.491286, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4914975, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4917943, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.492158, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4924471, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4939482, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4940782, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494666, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494841, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.494982, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4963996, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4967978, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4972138, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.497574, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4977288, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4980211, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4981887, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4984853, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4986522, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{ return(adapter.dispatch('drop_materialized_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4989386, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4990578, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4993184, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.4994693, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5001166, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5003486, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5006623, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5008285, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.501111, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5012784, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5020757, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5022664, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.502717, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.503441, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5039155, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5041127, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.504302, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{ return(adapter.dispatch('drop_table', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5045707, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5046806, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5049472, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.505205, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.506002, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5061529, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5073125, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5075188, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5077536, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5081522, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5083194, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.508509, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5089655, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{ return(adapter.dispatch('drop_view', 'dbt')(relation)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5092273, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.509347, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5096333, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5097988, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5111847, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5113523, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5122662, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5127149, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5133762, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.51391, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5140016, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5145123, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5147674, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5150764, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.515373, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5200992, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5208704, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5218837, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5226972, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.523524, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.52452, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5261784, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5265427, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5268352, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5271258, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.527716, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.534326, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5371664, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5373874, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5375335, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5376203, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5377383, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.53796, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5382853, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5385027, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5388627, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5390272, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5392506, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5425086, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.543395, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5465684, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5486617, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5510187, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5539088, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5551991, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5556056, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5585947, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5635045, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5642753, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5655823, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5658462, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5659597, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5660694, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5675666, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5681944, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5686183, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5690389, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5696428, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5701103, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5707417, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5722127, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5725346, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5726495, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5727627, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5728788, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.575372, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5755544, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5757294, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5759, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5780642, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5792766, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.579934, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5801167, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5802941, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.580472, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5806487, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5808432, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5848975, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5852907, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.586161, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5867047, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5868776, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.587049, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5872371, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5874052, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5875719, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5887566, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5890377, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5893145, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5895882, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.589858, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5901556, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5904613, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5907364, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.591145, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5922794, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5925586, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5935302, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.594265, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5950968, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5952818, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5954642, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5956492, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.595811, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5959911, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5964851, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5966487, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.596819, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5969815, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5971563, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5978396, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5989454, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5993629, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.5996263, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6004553, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6011596, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6020339, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6021883, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.602497, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.602807, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6029499, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6030903, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6032317, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6034584, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6037307, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.603846, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6039577, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604445, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604669, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.604918, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6052604, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6053824, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6055088, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6056223, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6057343, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6060684, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6062276, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6064444, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.606791, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6073132, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6076322, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6079805, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6084142, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6091926, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6125169, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6127903, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.613194, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6138375, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.614465, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.615379, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.615669, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6158142, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6161227, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6164942, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6175458, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6191769, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.619529, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6199052, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6225386, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6263828, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6290317, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6295319, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6297386, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.630116, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6307166, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6311295, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6314373, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.631912, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6320658, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6322157, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6323626, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6331723, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6334157, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6336021, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6338177, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6340046, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6341915, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.634382, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6354785, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6371627, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6378825, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.638804, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.641438, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6419206, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6426837, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.64347, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6440277, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6444867, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.645305, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6463099, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6466045, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6472042, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6480844, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6484706, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6491208, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6499507, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.650426, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6506236, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.651182, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6516619, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.652447, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6530967, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6537426, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.654092, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6544883, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6549392, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6556826, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6561031, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.656359, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6581447, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6624172, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6668148, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6679616, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6684742, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.668843, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6716087, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6732812, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6740654, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.675253, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6757865, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.676211, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6768825, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.677823, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6784434, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.67881, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.67939, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6801934, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6806834, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6810224, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6814587, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6819637, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.682548, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6830628, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6834679, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6838672, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6862533, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.687169, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.687351, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6878142, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6881015, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6883116, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6885767, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6887534, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6902397, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.691052, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.691792, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6926918, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.6996887, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7021585, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7046874, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7050817, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7055676, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7057788, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.705956, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.706071, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.706341, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7067366, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7068856, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7070363, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7072327, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7073457, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.707495, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7081776, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7083855, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.708536, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7086852, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.708846, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7090023, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7091582, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7093089, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7095282, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7097244, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7099123, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7103822, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7110858, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7112832, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7114577, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.711634, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7118077, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7119904, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7121646, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.712336, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7125447, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7130158, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7132938, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7135353, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.713739, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7141073, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7142665, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7144196, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7145884, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.714789, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7150235, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7153268, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7177646, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7181182, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7186062, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7189662, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.719576, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7200146, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7202086, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7204626, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7208142, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7215586, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7218008, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7220445, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722284, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7225304, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722752, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.722984, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7232156, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7244792, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.724724, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7249157, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7252154, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7254438, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7256732, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7258768, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.726155, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7264216, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7286198, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7288992, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7291834, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.729766, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.730309, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7309673, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7312453, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7319753, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7321808, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7323937, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7325985, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7328115, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7330074, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7332127, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7334166, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.733636, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7340186, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7341645, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7343087, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7344184, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.734528, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7346368, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7348373, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7352014, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7354374, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7358725, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7360942, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7362416, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.73639, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7367754, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7373083, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.737464, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.737931, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7381692, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7383242, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7388263, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7389858, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.739286, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7395456, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7396924, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7399056, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.740082, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7409, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.742336, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7429755, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7433035, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7438717, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7446074, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7450614, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7452736, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7458706, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7465248, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7471585, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7473993, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7477853, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7483766, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7492704, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.750048, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7506292, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.751605, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7523544, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.753097, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.753892, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7547834, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7553558, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7562356, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.757056, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7579021, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.758664, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7594085, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7605736, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7609818, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7625272, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7633734, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7640536, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7650406, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7656548, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7669747, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7683365, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7696702, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7718265, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7727106, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7733762, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.777071, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7777488, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7795248, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7841926, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7853687, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7857823, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7867718, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7872183, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7877665, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7890744, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.789586, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7900224, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7904615, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7911181, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7914238, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7926502, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7939343, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7959137, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7970212, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7977076, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7990885, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.7999501, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.800309, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8012693, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.802363, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.803096, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8044257, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.805517, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.806238, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8069174, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8074107, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8084247, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8086836, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8096614, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8101683, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8106477, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8113558, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8122814, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8133647, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.813623, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8140223, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8144488, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8153, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8160288, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.816262, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8171616, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8176754, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8204968, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8206196, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.825, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.825804, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8263352, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8276882, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8281374, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8287835, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8299263, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8307276, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8315558, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8318574, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8325183, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8330867, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8333359, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8335903, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.833848, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.834212, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8343337, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8344471, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8345587, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.83467, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8349922, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8350768, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835159, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8352547, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8353367, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8354166, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835496, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8356895, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.835969, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8363254, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.836601, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8367324, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.836844, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8372827, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8373632, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8374429, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.83753, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8376145, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8377979, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.837885, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.837969, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8380554, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8381393, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.838224, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.838306, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8398614, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8402214, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8407, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8412597, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8415964, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8419602, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.842266, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8425782, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8432724, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449577.8436368, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724266007.243057, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.974958, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9763288, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9778385, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9791083, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9799974, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.981989, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9848895, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9862425, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9875321, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9883466, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012254.9897618, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248349.1093776, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248349.1112146, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450331.6935074}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012255.364933, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}} diff --git a/tests/fixtures/dbt_17/target/run_results.json b/tests/fixtures/dbt_17/target/run_results.json index ca1d55a..05a335c 100644 --- a/tests/fixtures/dbt_17/target/run_results.json +++ b/tests/fixtures/dbt_17/target/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v5.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T07:12:34.999948Z", "invocation_id": "745125d0-5ac5-45a0-a498-db2b032d2c88", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:33.983359Z", "completed_at": "2024-09-25T07:12:33.992570Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.035052Z", "completed_at": "2024-09-25T07:12:34.035079Z"}], "thread_id": "Thread-4", "execution_time": 0.1200559139251709, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:33.994789Z", "completed_at": "2024-09-25T07:12:34.000585Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.037353Z", "completed_at": "2024-09-25T07:12:34.037381Z"}], "thread_id": "Thread-5", "execution_time": 0.1186060905456543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.002906Z", "completed_at": "2024-09-25T07:12:34.010140Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.046974Z", "completed_at": "2024-09-25T07:12:34.047004Z"}], "thread_id": "Thread-6", "execution_time": 0.12537169456481934, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:33.973401Z", "completed_at": "2024-09-25T07:12:34.026092Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.058566Z", "completed_at": "2024-09-25T07:12:34.058597Z"}], "thread_id": "Thread-3", "execution_time": 0.1426858901977539, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.012259Z", "completed_at": "2024-09-25T07:12:34.041836Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.077159Z", "completed_at": "2024-09-25T07:12:34.077181Z"}], "thread_id": "Thread-7", "execution_time": 0.20160436630249023, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.084022Z", "completed_at": "2024-09-25T07:12:34.177473Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.298963Z", "completed_at": "2024-09-25T07:12:34.298997Z"}], "thread_id": "Thread-8", "execution_time": 0.284454345703125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.277247Z", "completed_at": "2024-09-25T07:12:34.290808Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.335272Z", "completed_at": "2024-09-25T07:12:34.335292Z"}], "thread_id": "Thread-3", "execution_time": 0.18865489959716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.183871Z", "completed_at": "2024-09-25T07:12:34.296538Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.341919Z", "completed_at": "2024-09-25T07:12:34.341947Z"}], "thread_id": "Thread-1", "execution_time": 0.2586071491241455, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.198562Z", "completed_at": "2024-09-25T07:12:34.302147Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.347248Z", "completed_at": "2024-09-25T07:12:34.347270Z"}], "thread_id": "Thread-2", "execution_time": 0.2460036277770996, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.219427Z", "completed_at": "2024-09-25T07:12:34.304373Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.352507Z", "completed_at": "2024-09-25T07:12:34.352534Z"}], "thread_id": "Thread-4", "execution_time": 0.21763348579406738, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.250516Z", "completed_at": "2024-09-25T07:12:34.309257Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.358208Z", "completed_at": "2024-09-25T07:12:34.358238Z"}], "thread_id": "Thread-5", "execution_time": 0.22054123878479004, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.255861Z", "completed_at": "2024-09-25T07:12:34.311336Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.360632Z", "completed_at": "2024-09-25T07:12:34.360662Z"}], "thread_id": "Thread-6", "execution_time": 0.22147798538208008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.313481Z", "completed_at": "2024-09-25T07:12:34.349800Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.391877Z", "completed_at": "2024-09-25T07:12:34.391902Z"}], "thread_id": "Thread-7", "execution_time": 0.2162477970123291, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.400989Z", "completed_at": "2024-09-25T07:12:34.443946Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.651360Z", "completed_at": "2024-09-25T07:12:34.651393Z"}], "thread_id": "Thread-8", "execution_time": 0.2955465316772461, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.450826Z", "completed_at": "2024-09-25T07:12:34.636907Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.671473Z", "completed_at": "2024-09-25T07:12:34.671489Z"}], "thread_id": "Thread-3", "execution_time": 0.28357434272766113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.476804Z", "completed_at": "2024-09-25T07:12:34.653253Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.677480Z", "completed_at": "2024-09-25T07:12:34.677499Z"}], "thread_id": "Thread-1", "execution_time": 0.26845812797546387, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.494869Z", "completed_at": "2024-09-25T07:12:34.657195Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.681916Z", "completed_at": "2024-09-25T07:12:34.681935Z"}], "thread_id": "Thread-2", "execution_time": 0.2644779682159424, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.516574Z", "completed_at": "2024-09-25T07:12:34.659214Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.683420Z", "completed_at": "2024-09-25T07:12:34.683431Z"}], "thread_id": "Thread-5", "execution_time": 0.2584869861602783, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.539821Z", "completed_at": "2024-09-25T07:12:34.660219Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.685446Z", "completed_at": "2024-09-25T07:12:34.685464Z"}], "thread_id": "Thread-6", "execution_time": 0.25630736351013184, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.511277Z", "completed_at": "2024-09-25T07:12:34.669280Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.689572Z", "completed_at": "2024-09-25T07:12:34.689590Z"}], "thread_id": "Thread-4", "execution_time": 0.26877474784851074, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.664136Z", "completed_at": "2024-09-25T07:12:34.684504Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.705636Z", "completed_at": "2024-09-25T07:12:34.705662Z"}], "thread_id": "Thread-7", "execution_time": 0.21316742897033691, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.707266Z", "completed_at": "2024-09-25T07:12:34.720436Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.744964Z", "completed_at": "2024-09-25T07:12:34.744983Z"}], "thread_id": "Thread-8", "execution_time": 0.06830930709838867, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.721367Z", "completed_at": "2024-09-25T07:12:34.742122Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.758330Z", "completed_at": "2024-09-25T07:12:34.758342Z"}], "thread_id": "Thread-3", "execution_time": 0.06498074531555176, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.730517Z", "completed_at": "2024-09-25T07:12:34.750083Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.769774Z", "completed_at": "2024-09-25T07:12:34.769800Z"}], "thread_id": "Thread-1", "execution_time": 0.0796959400177002, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.736675Z", "completed_at": "2024-09-25T07:12:34.753223Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.776253Z", "completed_at": "2024-09-25T07:12:34.776268Z"}], "thread_id": "Thread-2", "execution_time": 0.07766437530517578, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.771002Z", "completed_at": "2024-09-25T07:12:34.796231Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.843102Z", "completed_at": "2024-09-25T07:12:34.843137Z"}], "thread_id": "Thread-5", "execution_time": 0.12132930755615234, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.783381Z", "completed_at": "2024-09-25T07:12:34.797241Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.845354Z", "completed_at": "2024-09-25T07:12:34.845375Z"}], "thread_id": "Thread-4", "execution_time": 0.1178433895111084, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.777656Z", "completed_at": "2024-09-25T07:12:34.798196Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.847563Z", "completed_at": "2024-09-25T07:12:34.847582Z"}], "thread_id": "Thread-6", "execution_time": 0.12085938453674316, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.810546Z", "completed_at": "2024-09-25T07:12:34.869830Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.899016Z", "completed_at": "2024-09-25T07:12:34.899030Z"}], "thread_id": "Thread-7", "execution_time": 0.12054944038391113, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.825355Z", "completed_at": "2024-09-25T07:12:34.870988Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.903651Z", "completed_at": "2024-09-25T07:12:34.903665Z"}], "thread_id": "Thread-8", "execution_time": 0.12345719337463379, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.849850Z", "completed_at": "2024-09-25T07:12:34.891700Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.909516Z", "completed_at": "2024-09-25T07:12:34.909530Z"}], "thread_id": "Thread-3", "execution_time": 0.12096071243286133, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.884323Z", "completed_at": "2024-09-25T07:12:34.901471Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.922420Z", "completed_at": "2024-09-25T07:12:34.922435Z"}], "thread_id": "Thread-2", "execution_time": 0.10601687431335449, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.877899Z", "completed_at": "2024-09-25T07:12:34.902504Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.923723Z", "completed_at": "2024-09-25T07:12:34.923749Z"}], "thread_id": "Thread-1", "execution_time": 0.11263322830200195, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.932694Z", "completed_at": "2024-09-25T07:12:34.953374Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.974437Z", "completed_at": "2024-09-25T07:12:34.974482Z"}], "thread_id": "Thread-4", "execution_time": 0.07423210144042969, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.926381Z", "completed_at": "2024-09-25T07:12:34.954811Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.975803Z", "completed_at": "2024-09-25T07:12:34.975812Z"}], "thread_id": "Thread-5", "execution_time": 0.07763552665710449, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.940098Z", "completed_at": "2024-09-25T07:12:34.955966Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.976904Z", "completed_at": "2024-09-25T07:12:34.976940Z"}], "thread_id": "Thread-6", "execution_time": 0.07706665992736816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.958186Z", "completed_at": "2024-09-25T07:12:34.978096Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.988383Z", "completed_at": "2024-09-25T07:12:34.988401Z"}], "thread_id": "Thread-7", "execution_time": 0.04577994346618652, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:12:34.969911Z", "completed_at": "2024-09-25T07:12:34.981015Z"}, {"name": "execute", "started_at": "2024-09-25T07:12:34.989463Z", "completed_at": "2024-09-25T07:12:34.989477Z"}], "thread_id": "Thread-8", "execution_time": 0.042598724365234375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}], "elapsed_time": 1.3086767196655273, "args": {"cache_selected_only": false, "log_level_file": "debug", "version_check": true, "print": true, "introspect": true, "warn_error_options": {"include": [], "exclude": []}, "defer": false, "send_anonymous_usage_stats": true, "project_dir": "dbt_project", "indirect_selection": "eager", "show_resource_report": false, "partial_parse": true, "printer_width": 80, "quiet": false, "static_parser": true, "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target", "vars": {}, "strict_mode": false, "use_colors": true, "log_format_file": "debug", "log_path": "dbt_project/logs", "empty_catalog": false, "use_colors_file": true, "favor_state": false, "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target", "macro_debugging": false, "profiles_dir": "dbt_project", "populate_cache": true, "static": false, "compile": true, "log_file_max_bytes": 10485760, "write_json": true, "partial_parse_file_diff": true, "enable_legacy_logger": false, "exclude": [], "select": [], "log_format": "default", "which": "generate", "log_level": "info"}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v5.json", "dbt_version": "1.7.0", "generated_at": "2024-09-25T09:40:34.539842Z", "invocation_id": "504619b0-99f2-43c4-8cc1-5a5e60e1c6e4", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.343089Z", "completed_at": "2024-09-25T09:40:33.346079Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.374907Z", "completed_at": "2024-09-25T09:40:33.374922Z"}], "thread_id": "Thread-4", "execution_time": 0.0764169692993164, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.347124Z", "completed_at": "2024-09-25T09:40:33.350391Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.377638Z", "completed_at": "2024-09-25T09:40:33.377650Z"}], "thread_id": "Thread-5", "execution_time": 0.06850194931030273, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.351491Z", "completed_at": "2024-09-25T09:40:33.355652Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.379745Z", "completed_at": "2024-09-25T09:40:33.379760Z"}], "thread_id": "Thread-6", "execution_time": 0.0650641918182373, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.336553Z", "completed_at": "2024-09-25T09:40:33.366040Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.387347Z", "completed_at": "2024-09-25T09:40:33.387364Z"}], "thread_id": "Thread-3", "execution_time": 0.08991789817810059, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.360699Z", "completed_at": "2024-09-25T09:40:33.378592Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.399715Z", "completed_at": "2024-09-25T09:40:33.399723Z"}], "thread_id": "Thread-7", "execution_time": 0.16469693183898926, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.407561Z", "completed_at": "2024-09-25T09:40:33.506431Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.585399Z", "completed_at": "2024-09-25T09:40:33.585433Z"}], "thread_id": "Thread-2", "execution_time": 0.21919608116149902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.424384Z", "completed_at": "2024-09-25T09:40:33.510877Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.592264Z", "completed_at": "2024-09-25T09:40:33.592285Z"}], "thread_id": "Thread-1", "execution_time": 0.22744154930114746, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.402347Z", "completed_at": "2024-09-25T09:40:33.517555Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.598811Z", "completed_at": "2024-09-25T09:40:33.598844Z"}], "thread_id": "Thread-8", "execution_time": 0.24764323234558105, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.574912Z", "completed_at": "2024-09-25T09:40:33.584686Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.633918Z", "completed_at": "2024-09-25T09:40:33.633946Z"}], "thread_id": "Thread-3", "execution_time": 0.14919304847717285, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.537552Z", "completed_at": "2024-09-25T09:40:33.589823Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.636135Z", "completed_at": "2024-09-25T09:40:33.636155Z"}], "thread_id": "Thread-5", "execution_time": 0.16645050048828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.519758Z", "completed_at": "2024-09-25T09:40:33.596682Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.642733Z", "completed_at": "2024-09-25T09:40:33.642754Z"}], "thread_id": "Thread-4", "execution_time": 0.21689128875732422, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.561383Z", "completed_at": "2024-09-25T09:40:33.608944Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.657377Z", "completed_at": "2024-09-25T09:40:33.657404Z"}], "thread_id": "Thread-6", "execution_time": 0.1756751537322998, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.614265Z", "completed_at": "2024-09-25T09:40:33.649030Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.684821Z", "completed_at": "2024-09-25T09:40:33.684849Z"}], "thread_id": "Thread-7", "execution_time": 0.15020442008972168, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.679477Z", "completed_at": "2024-09-25T09:40:33.737563Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.800204Z", "completed_at": "2024-09-25T09:40:33.800238Z"}], "thread_id": "Thread-2", "execution_time": 0.3231780529022217, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.702953Z", "completed_at": "2024-09-25T09:40:33.753780Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.965412Z", "completed_at": "2024-09-25T09:40:33.965450Z"}], "thread_id": "Thread-1", "execution_time": 0.33103513717651367, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.748608Z", "completed_at": "2024-09-25T09:40:33.807665Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.994833Z", "completed_at": "2024-09-25T09:40:33.994843Z"}], "thread_id": "Thread-8", "execution_time": 0.3174598217010498, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.763918Z", "completed_at": "2024-09-25T09:40:33.947367Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:33.997568Z", "completed_at": "2024-09-25T09:40:33.997596Z"}], "thread_id": "Thread-3", "execution_time": 0.30970144271850586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.789353Z", "completed_at": "2024-09-25T09:40:33.986242Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.005688Z", "completed_at": "2024-09-25T09:40:34.005706Z"}], "thread_id": "Thread-5", "execution_time": 0.2803530693054199, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.823410Z", "completed_at": "2024-09-25T09:40:33.991591Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.009504Z", "completed_at": "2024-09-25T09:40:34.009525Z"}], "thread_id": "Thread-4", "execution_time": 0.2758150100708008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.937180Z", "completed_at": "2024-09-25T09:40:33.993932Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.012500Z", "completed_at": "2024-09-25T09:40:34.012519Z"}], "thread_id": "Thread-6", "execution_time": 0.2810859680175781, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:33.975573Z", "completed_at": "2024-09-25T09:40:34.000866Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.019962Z", "completed_at": "2024-09-25T09:40:34.019976Z"}], "thread_id": "Thread-7", "execution_time": 0.2749752998352051, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.021248Z", "completed_at": "2024-09-25T09:40:34.062400Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.101301Z", "completed_at": "2024-09-25T09:40:34.101333Z"}], "thread_id": "Thread-2", "execution_time": 0.11756205558776855, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.032158Z", "completed_at": "2024-09-25T09:40:34.065685Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.112285Z", "completed_at": "2024-09-25T09:40:34.112305Z"}], "thread_id": "Thread-1", "execution_time": 0.1210782527923584, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.068406Z", "completed_at": "2024-09-25T09:40:34.114747Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.173290Z", "completed_at": "2024-09-25T09:40:34.173319Z"}], "thread_id": "Thread-8", "execution_time": 0.17077851295471191, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.073897Z", "completed_at": "2024-09-25T09:40:34.116955Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.175534Z", "completed_at": "2024-09-25T09:40:34.175555Z"}], "thread_id": "Thread-3", "execution_time": 0.17470860481262207, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.141374Z", "completed_at": "2024-09-25T09:40:34.201072Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.269112Z", "completed_at": "2024-09-25T09:40:34.269141Z"}], "thread_id": "Thread-5", "execution_time": 0.18143892288208008, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.156178Z", "completed_at": "2024-09-25T09:40:34.208577Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.274169Z", "completed_at": "2024-09-25T09:40:34.274194Z"}], "thread_id": "Thread-4", "execution_time": 0.18596339225769043, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.177696Z", "completed_at": "2024-09-25T09:40:34.215120Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.279914Z", "completed_at": "2024-09-25T09:40:34.279944Z"}], "thread_id": "Thread-6", "execution_time": 0.17755770683288574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.223675Z", "completed_at": "2024-09-25T09:40:34.276515Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.334075Z", "completed_at": "2024-09-25T09:40:34.334113Z"}], "thread_id": "Thread-7", "execution_time": 0.16649699211120605, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.249127Z", "completed_at": "2024-09-25T09:40:34.284328Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.338710Z", "completed_at": "2024-09-25T09:40:34.338734Z"}], "thread_id": "Thread-1", "execution_time": 0.16529464721679688, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.238656Z", "completed_at": "2024-09-25T09:40:34.291646Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.344627Z", "completed_at": "2024-09-25T09:40:34.344658Z"}], "thread_id": "Thread-2", "execution_time": 0.1730358600616455, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.301958Z", "completed_at": "2024-09-25T09:40:34.346970Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.393043Z", "completed_at": "2024-09-25T09:40:34.393074Z"}], "thread_id": "Thread-8", "execution_time": 0.16309499740600586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.318418Z", "completed_at": "2024-09-25T09:40:34.351737Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.401911Z", "completed_at": "2024-09-25T09:40:34.401936Z"}], "thread_id": "Thread-3", "execution_time": 0.1614384651184082, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.380237Z", "completed_at": "2024-09-25T09:40:34.435231Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.487227Z", "completed_at": "2024-09-25T09:40:34.487255Z"}], "thread_id": "Thread-5", "execution_time": 0.158447265625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.395479Z", "completed_at": "2024-09-25T09:40:34.442438Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.490479Z", "completed_at": "2024-09-25T09:40:34.490502Z"}], "thread_id": "Thread-4", "execution_time": 0.1536271572113037, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.414135Z", "completed_at": "2024-09-25T09:40:34.445305Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.494972Z", "completed_at": "2024-09-25T09:40:34.494994Z"}], "thread_id": "Thread-6", "execution_time": 0.150909423828125, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.460077Z", "completed_at": "2024-09-25T09:40:34.492621Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.513057Z", "completed_at": "2024-09-25T09:40:34.513080Z"}], "thread_id": "Thread-1", "execution_time": 0.09395599365234375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:34.449603Z", "completed_at": "2024-09-25T09:40:34.497083Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:34.515658Z", "completed_at": "2024-09-25T09:40:34.515679Z"}], "thread_id": "Thread-7", "execution_time": 0.11023592948913574, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}], "elapsed_time": 1.4404709339141846, "args": {"warn_error_options": {"include": [], "exclude": []}, "cache_selected_only": false, "compile": true, "quiet": false, "introspect": true, "write_json": true, "defer": false, "log_format": "default", "log_path": "dbt_project/logs", "project_dir": "dbt_project", "select": [], "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target", "show_resource_report": false, "log_file_max_bytes": 10485760, "print": true, "strict_mode": false, "use_colors_file": true, "which": "generate", "macro_debugging": false, "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_17/target", "vars": {}, "log_level": "info", "empty_catalog": false, "exclude": [], "printer_width": 80, "populate_cache": true, "enable_legacy_logger": false, "log_level_file": "debug", "use_colors": true, "profiles_dir": "dbt_project", "version_check": true, "favor_state": false, "indirect_selection": "eager", "log_format_file": "debug", "send_anonymous_usage_stats": true, "partial_parse": true, "static": false, "static_parser": true, "partial_parse_file_diff": true}} diff --git a/tests/fixtures/dbt_18/target/catalog.json b/tests/fixtures/dbt_18/target/catalog.json index ed4ba83..98d80d2 100644 --- a/tests/fixtures/dbt_18/target/catalog.json +++ b/tests/fixtures/dbt_18/target/catalog.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T07:13:20.079321Z", "invocation_id": "78e56a75-e61f-4b5d-8dc4-e1d066acd90a", "env": {}}, "nodes": {"model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "snapshots", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}}, "sources": {}, "errors": null} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T09:40:53.878434Z", "invocation_id": "d58710f9-9cc9-4f55-824b-aa1c85ec8b54", "env": {}}, "nodes": {"snapshot.dbt_bouncer_test_project.orders_snapshot": {"metadata": {"type": "BASE TABLE", "schema": "dbt_pslattery", "name": "orders_snapshot", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "dbt_scd_id": {"type": "VARCHAR", "index": 5, "name": "dbt_scd_id", "comment": null}, "dbt_updated_at": {"type": "DATE", "index": 6, "name": "dbt_updated_at", "comment": null}, "dbt_valid_from": {"type": "DATE", "index": 7, "name": "dbt_valid_from", "comment": null}, "dbt_valid_to": {"type": "DATE", "index": 8, "name": "dbt_valid_to", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot"}, "model.dbt_bouncer_test_project.customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}, "first_order_date": {"type": "DATE", "index": 4, "name": "first_order_date", "comment": null}, "most_recent_order_date": {"type": "DATE", "index": 5, "name": "most_recent_order_date", "comment": null}, "number_of_orders": {"type": "BIGINT", "index": 6, "name": "number_of_orders", "comment": null}, "is_recurring_customer": {"type": "BOOLEAN", "index": 7, "name": "is_recurring_customer", "comment": null}, "customer_lifetime_value": {"type": "DOUBLE", "index": 8, "name": "customer_lifetime_value", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.customers"}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "metricflow_time_spine", "database": "dbt", "comment": null, "owner": null}, "columns": {"date_day": {"type": "DATE", "index": 1, "name": "date_day", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine"}, "model.dbt_bouncer_test_project.orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}, "credit_card_amount": {"type": "DOUBLE", "index": 5, "name": "credit_card_amount", "comment": null}, "coupon_amount": {"type": "DOUBLE", "index": 6, "name": "coupon_amount", "comment": null}, "bank_transfer_amount": {"type": "DOUBLE", "index": 7, "name": "bank_transfer_amount", "comment": null}, "gift_card_amount": {"type": "DOUBLE", "index": 8, "name": "gift_card_amount", "comment": null}, "amount": {"type": "DOUBLE", "index": 9, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.orders"}, "seed.dbt_bouncer_test_project.raw_customers": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_customers"}, "seed.dbt_bouncer_test_project.raw_orders": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "user_id": {"type": "INTEGER", "index": 2, "name": "user_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_orders"}, "seed.dbt_bouncer_test_project.raw_payments": {"metadata": {"type": "BASE TABLE", "schema": "main", "name": "raw_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"id": {"type": "INTEGER", "index": 1, "name": "id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "INTEGER", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.dbt_bouncer_test_project.raw_payments"}, "model.dbt_bouncer_test_project.stg_customers": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_customers", "database": "dbt", "comment": null, "owner": null}, "columns": {"customer_id": {"type": "BIGINT", "index": 1, "name": "customer_id", "comment": null}, "first_name": {"type": "VARCHAR", "index": 2, "name": "first_name", "comment": null}, "last_name": {"type": "VARCHAR", "index": 3, "name": "last_name", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_customers"}, "model.dbt_bouncer_test_project.stg_orders": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_orders", "database": "dbt", "comment": null, "owner": null}, "columns": {"order_id": {"type": "INTEGER", "index": 1, "name": "order_id", "comment": null}, "customer_id": {"type": "INTEGER", "index": 2, "name": "customer_id", "comment": null}, "order_date": {"type": "DATE", "index": 3, "name": "order_date", "comment": null}, "status": {"type": "VARCHAR", "index": 4, "name": "status", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_orders"}, "model.dbt_bouncer_test_project.stg_payments": {"metadata": {"type": "VIEW", "schema": "main", "name": "stg_payments", "database": "dbt", "comment": null, "owner": null}, "columns": {"payment_id": {"type": "INTEGER", "index": 1, "name": "payment_id", "comment": null}, "order_id": {"type": "INTEGER", "index": 2, "name": "order_id", "comment": null}, "payment_method": {"type": "VARCHAR", "index": 3, "name": "payment_method", "comment": null}, "amount": {"type": "DOUBLE", "index": 4, "name": "amount", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "model.dbt_bouncer_test_project.stg_payments"}}, "sources": {}, "errors": null} diff --git a/tests/fixtures/dbt_18/target/manifest.json b/tests/fixtures/dbt_18/target/manifest.json index 27a683d..07b2830 100644 --- a/tests/fixtures/dbt_18/target/manifest.json +++ b/tests/fixtures/dbt_18/target/manifest.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T07:13:18.103695Z", "invocation_id": "78e56a75-e61f-4b5d-8dc4-e1d066acd90a", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449595.0980532, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449595.1832144, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449595.191793, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449595.2229528, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.728382, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.7297914, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.731127, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2626848, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2616355, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2588797, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2661777, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.263526, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3358166, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3317177, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3325214, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.333019, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.333927, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3306043, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3348942, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9028952, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9234703, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9272459, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9310117, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9351516, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9388435, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.942528, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.163656, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.164794, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449595.1658564, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1854324, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1863756, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449595.187339, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1922855, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1949291, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449595.1957488, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2253199, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2261689, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2269843, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2278244, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449595.231973, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2343636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2352116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2360294, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2368486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2376633, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2667127, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2676814, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449595.2685745, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.27404, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2748637, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449595.2756917, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2781255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.279022, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449595.280099, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2827075, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2836335, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449595.2845573, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2873259, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2881603, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true}, "created_at": 1723449595.2893775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449595.290719, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3363645, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449595.3373928, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3397474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449595.340602, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.342983, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449595.3438327, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3466344, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449595.3475626, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3498516, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.350876, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449595.3517792, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3541522, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3551278, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449595.3559504, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.358131, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.35906, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449595.3598816, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450347.7217855, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723450347.7841606, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723450347.7853687, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136615.6139448, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136615.6811168, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602100.2547586, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3198235, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3210306, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3220053, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381781.894404, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.821509, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.9449537, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.9466112, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "snapshots", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "66c7297a2e7bafae8b9569abeee9f364001518a84ee37f26c722b00dcb9b3d3f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "snapshots", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"target_database": "dbt", "target_schema": "snapshots", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727248393.7120771, "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\"", "raw_code": "\n\n{{\n config(\n target_database='dbt',\n target_schema='snapshots',\n unique_key='id',\n\n strategy='timestamp',\n updated_at='order_date',\n )\n}}\n\nselect * from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449595.3663583}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449595.3665066}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449595.3667078}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449595.3668473}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449595.3671622}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449595.3673224}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449595.3674653}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450347.8571322}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450347.8579187}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450347.8580358}}, "macros": {"macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n with relations AS (\n select\n t.table_name\n , t.database_name\n , t.schema_name\n , 'BASE TABLE' as table_type\n , {{ adapter.catalog_comment('t') }} as table_comment\n from duckdb_tables() t\n WHERE t.database_name = '{{ database }}'\n UNION ALL\n SELECT v.view_name as table_name\n , v.database_name\n , v.schema_name\n , 'VIEW' as table_type\n , {{ adapter.catalog_comment('v') }} as table_comment\n from duckdb_views() v\n WHERE v.database_name = '{{ database }}'\n )\n select\n '{{ database }}' as table_database,\n r.schema_name as table_schema,\n r.table_name,\n r.table_type,\n r.table_comment,\n c.column_name,\n c.column_index as column_index,\n c.data_type as column_type,\n {{ adapter.catalog_comment('c') }} as column_comment,\n '' as table_owner\n FROM relations r JOIN duckdb_columns() c ON r.schema_name = c.schema_name AND r.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(r.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ORDER BY\n r.schema_name,\n r.table_name,\n c.column_index\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4463005, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4475856, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4477088, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4495382, "supported_languages": null}, "macro.dbt_duckdb.duckdb_escape_comment": {"name": "duckdb_escape_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb_escape_comment", "macro_sql": "{% macro duckdb_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.450551, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_comment": {"name": "duckdb__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_comment", "macro_sql": "{% macro duckdb__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4507952, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_column_comment": {"name": "duckdb__alter_column_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_column_comment", "macro_sql": "{% macro duckdb__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4514182, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4523528, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4541702, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n date_diff('{{ datepart }}', {{ first_date }}::timestamp, {{ second_date}}::timestamp )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4558153, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n date_add({{ from_date_or_timestamp }}, interval ({{ interval }}) {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4560313, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4565253, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.45893, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4594824, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4600596, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4601974, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4604046, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n -- only create temp tables if using local duckdb, as it is not currently supported for remote databases\n {%- set temporary = not adapter.is_motherduck() -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if not temporary %}\n -- if not using a temporary table we will update the temp relation to use a different temp schema (\"dbt_temp\" by default)\n {% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}\n {% do run_query(create_schema(temp_relation)) %}\n -- then drop the temp relation after we insert the incremental data into the target relation\n {% do to_drop.append(temp_relation) %}\n {% endif %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(temporary, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.create_schema", "macro.dbt.statement", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4665885, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {%- set partition_columns = config.get('partition_columns', []) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4715922, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4742012, "supported_languages": ["sql", "python"]}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4774044, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4779708, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4791145, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4793231, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4794405, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4797654, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4799383, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.480478, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4806614, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.480934, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4811747, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4812834, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.481596, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4817681, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482042, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482184, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4825318, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4827125, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482977, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.483105, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4833808, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4835274, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4837747, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4839857, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.484818, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.484973, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4851348, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4852846, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4854434, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4855928, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4857616, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4859447, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4861133, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4862707, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4864364, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4865813, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4867427, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.486893, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.487256, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4875052, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4878707, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4881897, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4884422, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.488558, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4888704, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4890184, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4893143, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4894626, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.489806, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490186, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490353, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490965, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4914193, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4917514, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4919336, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.492197, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.492317, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4925513, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4926374, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.49289, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4929807, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.493264, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4934158, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4937224, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4938846, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4941366, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4942484, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4944944, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4946845, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.495411, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4958687, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.496071, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4967382, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4975493, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4983308, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4985883, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4990795, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4994674, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4996588, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.500216, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5005383, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5008986, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5013785, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5018115, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.50223, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.502523, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.502918, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5032756, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.50365, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5049028, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5051563, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5053356, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5055187, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.505694, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5330665, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5372179, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5382974, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5385256, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5390217, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5391989, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5393286, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5394633, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5395758, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5397258, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5398443, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5402925, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.540462, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.541727, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5443456, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5483952, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5487695, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5490835, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5505536, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5507824, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5514057, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5540962, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5548146, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5597177, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5675492, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5687304, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5700972, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5709288, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5722752, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5728443, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.573543, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.573784, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.574532, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5794518, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5810852, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5813508, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5824816, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5827463, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5834088, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5868173, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5870593, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5871775, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5874553, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5876257, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5879672, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5883443, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.589277, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5895977, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.589827, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5904853, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5922272, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.59482, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5954444, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.595617, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5958173, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5959847, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5962534, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5967326, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5986784, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5988395, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5991473, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5993648, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5995746, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.599757, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6009407, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6012993, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6014853, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6018329, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6020563, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.602709, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.602955, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6037521, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.604118, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6043088, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6044712, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6046567, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.606413, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6065803, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6067967, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60709, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60733, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.607651, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.607831, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.608016, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6082563, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6088028, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6090267, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.609168, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6095634, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6097574, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ compiled_code }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60996, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6127648, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6130505, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6132553, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6135445, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.613754, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6139503, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.614152, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6144326, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6146562, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6149867, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6151886, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6153502, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.615814, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.615988, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.616158, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6163127, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6165178, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6166914, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6196828, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6198034, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6199682, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6200829, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6204288, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.62061, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6207342, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.620958, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6211677, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6213892, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6216059, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6218414, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6226187, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6228004, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6230497, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.62327, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6244094, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6255033, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6257339, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6264598, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6265984, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.626765, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6271667, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.627351, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6274915, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.627651, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6277816, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6293473, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.630598, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6314242, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6316533, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6330643, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.633645, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.63394, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6342406, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6345625, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6351027, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6353357, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.635646, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6358578, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6361144, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6363306, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6370363, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6382391, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6385763, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6388426, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6392782, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.639727, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.640039, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6402524, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6408947, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6412976, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6414795, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6416814, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6418767, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6425216, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6430593, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6432755, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.643588, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6439612, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6442156, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6451497, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6452813, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6458929, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6460726, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6462092, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6475778, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6479623, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.648293, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6485872, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6487212, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.648985, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6491337, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.649391, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6495352, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6497664, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.64989, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.650146, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6502936, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6508446, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6510336, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6513216, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.651473, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6517348, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6519666, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6527352, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6529198, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.653349, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6540658, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.654555, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.654737, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6549127, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6551495, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6552737, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6555343, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.655682, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6564372, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.656588, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6577268, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6579428, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6582046, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6586063, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6587663, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6589444, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6593766, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6596138, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6597402, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6599977, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6601493, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6615598, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6618226, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.662677, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6630836, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6636686, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6641374, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.664219, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.664764, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6650388, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6653695, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6656623, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.670198, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.670988, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6718872, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6726189, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6733458, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6742544, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6757834, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6761248, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.676401, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6766715, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6772294, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6837811, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6864185, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.686606, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6867318, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.686815, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6869276, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6871345, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6874397, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6876416, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6879823, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6881347, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6883404, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6910837, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6919754, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.694666, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6964226, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6984131, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.701131, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7022405, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7026224, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.705576, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7104392, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7127445, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.712857, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7129629, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7144463, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7150095, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.715401, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.715781, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7163353, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7167897, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7173762, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.718753, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7190661, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7191782, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7192879, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7193968, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7218153, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.721989, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7221563, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7223186, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.724134, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.725256, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7259011, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.726075, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7262425, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7264113, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.726579, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7267604, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.730571, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7309403, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7317255, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7322392, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732405, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7325666, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732747, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732911, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7330701, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7342584, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.734524, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7347848, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7350452, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7352962, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.735578, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7358563, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7361042, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7364633, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7375789, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7378466, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7386963, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7393372, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7401664, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7403426, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.740515, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7406867, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7408555, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7410293, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7414942, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7416813, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7418604, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7420402, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7422323, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7430308, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7441275, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.744512, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.744759, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7454956, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7461123, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.74697, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7471237, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.747415, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7477202, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7478588, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7479959, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7482169, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7483487, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7485979, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7487004, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7488046, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.749265, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.749477, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7497013, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7500849, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7502055, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7503257, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7504346, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.750543, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7508805, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7510319, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.751233, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7515569, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7520452, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7523699, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.752734, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.753227, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7540073, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7571056, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7573533, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.757739, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7583256, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7589285, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7598007, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7600968, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7602293, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.760511, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.760843, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.761794, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7633598, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7637403, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7641284, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.76673, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.770514, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7729647, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.773444, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7736561, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7740467, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7745993, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.774974, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7752495, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7757077, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7758496, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7759902, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.776131, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7769108, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7771366, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7773051, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7774994, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7776692, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7778404, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7780154, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7790716, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7805939, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7812188, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.782116, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7847788, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7852447, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7860212, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.786749, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7872517, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7877283, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7885392, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7895055, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7898, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.790391, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.791187, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7915545, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.792161, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.792928, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7934082, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.793616, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7942061, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7946587, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7953763, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7959723, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7965486, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7968738, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.797239, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7976983, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7983692, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7987227, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.798951, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8005598, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8047006, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.808808, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8099217, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.810478, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8108606, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8138814, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8155847, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8163893, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8177607, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8182986, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8187299, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8208725, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8212132, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8217897, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8225286, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8229685, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.823263, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8236592, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8241062, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.824636, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.825115, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.825505, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8258636, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.828044, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8289528, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.829129, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8295908, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8298762, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8300724, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8303144, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.830475, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8478096, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8479664, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8481202, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8483179, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8484259, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8485677, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8505104, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8506973, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8538115, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.854541, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8546774, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.85481, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8549433, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8577392, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8580701, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8584945, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.858958, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8594937, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8599114, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8600986, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8603287, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8606167, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8612316, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8614295, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.861671, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.861925, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.862187, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8624423, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8626645, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8628862, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8640497, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8642724, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8644342, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8646832, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8648863, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.865083, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8652608, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.865519, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.867914, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.868182, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8684485, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.869014, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.869407, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8700259, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8702855, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.871002, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8712003, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8714106, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8716178, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8718271, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8720245, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8722267, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8724246, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8730087, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.873151, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8733017, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.873419, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8735332, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8736491, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8794851, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8808777, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8815122, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8818643, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8824742, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8832152, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8836327, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8838165, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8843446, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8849876, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8855903, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8858185, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8861806, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.886746, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8876815, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8884034, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8889673, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8898108, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8905165, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8912206, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8919356, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.892797, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8933547, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8942213, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.895013, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8957312, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8964803, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8972242, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8986084, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8990061, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9005294, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9013507, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9020114, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9029448, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9035265, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9047477, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9060702, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9073575, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9092526, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9100351, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9106, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9211695, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.921475, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9222558, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.922604, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.923071, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9241962, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9246168, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9249802, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9253695, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9259686, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9262612, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9273715, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.928509, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9321702, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9335992, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.934489, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9348469, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.935849, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9387977, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9398735, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9405658, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9412422, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9417813, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.942923, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.943208, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9442077, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9447074, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.945177, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9458745, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9467738, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9477406, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9479759, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.948353, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.948754, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.949555, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.950206, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9504163, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.951443, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.951872, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.954668, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9547868, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.959399, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9599504, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9604, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9616988, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9621842, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9627671, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9637437, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.964469, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9653292, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9656882, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.966461, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9670193, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9672484, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967459, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967666, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967965, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9680731, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9681816, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.968291, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9684014, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.968701, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0036144, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0037289, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0038218, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0039022, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0039823, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0040598, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.004289, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0045583, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0048196, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0051165, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0052423, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0053494, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.00585, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0059462, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0060408, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0061338, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0062184, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006382, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0064635, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006549, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006625, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006699, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0067751, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0069246, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0083883, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0087452, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0091963, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0097046, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0100322, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0103803, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0106652, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0109553, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0115445, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0118933, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724266024.824925, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2768002, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2783475, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2790623, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2800255, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2811193, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2822332, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2831764, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2841876, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2849853, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2864697, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2886405, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n {% set sql %}\n select type from duckdb_databases()\n where database_name='{{ relation.database }}'\n and type='sqlite'\n {% endset %}\n {% set results = run_query(sql) %}\n {% if results|length == 0 %}\n create schema if not exists {{ relation.without_identifier() }}\n {% else %}\n {% if relation.schema!='main' %}\n {{ exceptions.raise_compiler_error(\n \"Schema must be 'main' when writing to sqlite \"\n ~ \"instead got \" ~ relation.schema\n )}}\n {% endif %}\n {% endif %}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.394155, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3949244, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3954024, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.395774, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3963099, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3978589, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3981087, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3987157, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3994641, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.39996, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4002833, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.400738, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.401311, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4014332, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4016986, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4018571, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4020784, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4022996, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4026256, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format, config) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format, config) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4030533, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% if options is not mapping %}\n {% do exceptions.raise_compiler_error(\"The options argument must be a dictionary\") %}\n {% endif %}\n\n {% for k in options %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4044728, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4057293, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4063513, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4065719, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4071171, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4077265, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4085588, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.408781, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4089947, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4091523, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4097521, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4099922, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4101048, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4103446, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4110563, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4176369, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4180877, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4183512, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4185116, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4187484, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4189467, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4193237, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4197416, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where {{ columns.dbt_valid_to }} is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.421598, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4218664, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4225, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4231298, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.423987, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.424637, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.valid_snapshot_target(target_relation, columns) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.43159, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.435515, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.435766, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4360983, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4374356, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.437696, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.437965, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.439996, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4419692, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4426734, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4433992, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4446914, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.445039, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4453127, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4457414, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4460135, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4464412, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.446711, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4470913, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4473774, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4476044, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4478714, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4481091, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4485242, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4495187, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.451391, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4523482, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.453586, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.453884, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.454253, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4545014, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4562974, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4573998, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4584093, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4595075, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4678535, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4712567, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.474707, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4753418, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4756503, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4758546, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4760573, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4769883, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4772637, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4774668, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4776669, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4778755, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4780793, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4782805, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4784832, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4793513, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4795914, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4798098, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4800253, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4802425, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4804635, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4806652, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4808655, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4815176, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4818614, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.482529, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4827323, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4830334, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.483327, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4835339, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4838355, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4841328, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4846423, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.484896, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4852304, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.48553, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4860015, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.486258, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4865882, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.486884, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4873843, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4876373, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.488154, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4884355, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4890475, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.48939, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4896066, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4897609, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4904313, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4906466, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4910686, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4914405, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4916534, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4973104, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5012617, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5020745, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5042186, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5065024, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5080137, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5091913, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5100927, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5119727, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5143006, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450347.8033903}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": ["model.dbt_bouncer_test_project.orders"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "unit_test.dbt_bouncer_test_project.orders.test_amount_logic"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "unit_test.dbt_bouncer_test_project.customers.test_clv_logic"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": [], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": [], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012272.4653726, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}, "unit_tests": {"unit_test.dbt_bouncer_test_project.customers.test_clv_logic": {"model": "customers", "given": [{"input": "ref('stg_customers')", "rows": "select 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name", "format": "sql", "fixture": null}, {"input": "ref('stg_orders')", "rows": [{"customer_id": 1, "order_date": "2022-01-01", "order_id": 1}, {"customer_id": 1, "order_date": "2022-01-02", "order_id": 2}, {"customer_id": 2, "order_date": "2022-01-02", "order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"order_id": "1", "amount": "100"}, {"order_id": "2", "amount": "50"}, {"order_id": "3", "amount": "25"}], "format": "csv", "fixture": "stg_payments"}], "expect": {"rows": [{"customer_id": 1, "customer_lifetime_value": 150}, {"customer_id": 2, "customer_lifetime_value": 25}, {"customer_id": 3, "customer_lifetime_value": 0}], "format": "dict", "fixture": null}, "name": "test_clv_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers", "test_clv_logic"], "description": "Validate CLV logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "config": {"tags": [], "meta": {}}, "checksum": "c42689c77eb9cdd188cb7664846e92985c7d1a130fb02d8f88070d88a047aad2", "schema": "main", "created_at": 1724580241.8318431, "versions": null, "version": null}, "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": {"model": "orders", "given": [{"input": "ref('stg_orders')", "rows": [{"order_id": 1}, {"order_id": 2}, {"order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"amount": 10, "order_id": 1, "payment_method": "credit_card"}, {"amount": 20, "order_id": 2, "payment_method": "credit_card"}, {"amount": 30, "order_id": 3, "payment_method": "coupon"}], "format": "dict", "fixture": null}], "expect": {"rows": [{"amount": 10, "order_id": 1, "coupon_amount": 0, "credit_card_amount": 10}, {"amount": 20, "order_id": 2, "coupon_amount": 0, "credit_card_amount": 20}, {"amount": 30, "order_id": 3, "coupon_amount": 30, "credit_card_amount": 0}], "format": "dict", "fixture": null}, "name": "test_amount_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders", "test_amount_logic"], "description": "Validate amount logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "config": {"tags": [], "meta": {}}, "checksum": "5b656bfcdd083e4af89f4c506f86484bd9ca1894e07b20a4f8a8f33aaf8a0849", "schema": "main", "created_at": 1724601893.3793342, "versions": null, "version": null}}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T09:40:51.914796Z", "invocation_id": "d58710f9-9cc9-4f55-824b-aa1c85ec8b54", "env": {}, "project_name": "dbt_bouncer_test_project", "project_id": "52e2b356b2b0bade408c5d8ef6aa0066", "user_id": "1aa00824-5aec-45e1-a1a3-b8a868297099", "send_anonymous_usage_stats": true, "adapter_type": "duckdb"}, "nodes": {"model.dbt_bouncer_test_project.stg_payments": {"database": "dbt", "schema": "main", "name": "stg_payments", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/payments/stg_payments.sql", "original_file_path": "models/staging/payments/stg_payments.sql", "unique_id": "model.dbt_bouncer_test_project.stg_payments", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "stg_payments"], "alias": "stg_payments", "checksum": {"name": "sha256", "checksum": "11e0567835979675b3523fbcd5c72a7133bacb0d8059f6bc224605f6ac65a6df"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Staging table for payment data.", "columns": {"payment_id": {"name": "payment_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "payment_method": {"name": "payment_method", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/payments/_stg_payments__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "gold"}}, "created_at": 1723449595.0980532, "relation_name": "\"dbt\".\"main\".\"stg_payments\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_payments\") }}\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n {{ cents_to_dollars(\"amount\") }} as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.cents_to_dollars"], "nodes": ["seed.dbt_bouncer_test_project.raw_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/stg_payments.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.stg_orders": {"database": "dbt", "schema": "main", "name": "stg_orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_orders.sql", "original_file_path": "models/staging/crm/stg_orders.sql", "unique_id": "model.dbt_bouncer_test_project.stg_orders", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_orders"], "alias": "stg_orders", "checksum": {"name": "sha256", "checksum": "31f8baee5c6a9ff489abc8670cc62c71dea9c7a080f500ffa9f980e11be1d55c"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for orders data.", "columns": {"order_id": {"name": "order_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723449595.1832144, "relation_name": "\"dbt\".\"main\".\"stg_orders\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select * from {{ ref(\"raw_orders\") }}\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_orders.sql", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.int_model_1": {"database": "dbt", "schema": "main", "name": "int_model_1", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_model_1.sql", "original_file_path": "models/intermediate/finance/int_model_1.sql", "unique_id": "model.dbt_bouncer_test_project.int_model_1", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_model_1"], "alias": "int_model_1", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lithium"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Super basic model that has a description and a test", "columns": {"id": {"name": "id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "lithium"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lithium"}, "materialized": "ephemeral"}, "created_at": 1723449595.191793, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_model_1.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.dbt_bouncer_test_project.orders": {"database": "dbt", "schema": "main", "name": "orders", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/orders.sql", "original_file_path": "models/marts/finance/orders.sql", "unique_id": "model.dbt_bouncer_test_project.orders", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders"], "alias": "orders", "checksum": {"name": "sha256", "checksum": "ce5ee4f7e44c57e6b32eb425f7be7c4e4fd0f6dc8331c297126bbd3a14267e8d"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about orders, as well as some derived facts based on payments", "columns": {"order_id": {"name": "order_id", "description": "This is a unique identifier for an order", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "customer_id": {"name": "customer_id", "description": "Foreign key to the customers table", "meta": {}, "data_type": "integer", "constraints": [], "quote": null, "tags": []}, "order_date": {"name": "order_date", "description": "Date (UTC) that the order was placed", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "amount": {"name": "amount", "description": "Total amount (AUD) of the order", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "credit_card_amount": {"name": "credit_card_amount", "description": "Amount of the order (AUD) paid for by credit card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "coupon_amount": {"name": "coupon_amount", "description": "Amount of the order (AUD) paid for by coupon", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "bank_transfer_amount": {"name": "bank_transfer_amount", "description": "Amount of the order (AUD) paid for by bank transfer", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}, "gift_card_amount": {"name": "gift_card_amount", "description": "Amount of the order (AUD) paid for by gift card", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}}, "created_at": 1723449595.2229528, "relation_name": "\"dbt\".\"main\".\"orders\"", "raw_code": "{% set payment_methods = [\"credit_card\", \"coupon\", \"bank_transfer\", \"gift_card\"] %}\n\nwith\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n order_payments as (\n\n select\n order_id,\n\n {% for payment_method in payment_methods -%}\n sum(\n case\n when payment_method = '{{ payment_method }}' then amount else 0\n end\n ) as {{ payment_method }}_amount,\n {% endfor -%}\n\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n {% for payment_method in payment_methods -%}\n\n order_payments.{{ payment_method }}_amount,\n\n {% endfor -%}\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/orders.sql", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "f11aaa179a3fc3d56186705b7f6474d95e2e3df1006a3bb602228e9ff0b47f67"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "seed.dbt_bouncer_test_project.raw_orders": {"database": "dbt", "schema": "main", "name": "raw_orders", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_orders.csv", "original_file_path": "seeds/raw_orders.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "fqn": ["dbt_bouncer_test_project", "raw_orders"], "alias": "raw_orders", "checksum": {"name": "sha256", "checksum": "ddecd7adf70a07a88b9c302aec2a03fce615b925c2c06f2d5ef99a5c97b41250"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.728382, "relation_name": "\"dbt\".\"main\".\"raw_orders\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_payments": {"database": "dbt", "schema": "main", "name": "raw_payments", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_payments.csv", "original_file_path": "seeds/raw_payments.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "fqn": ["dbt_bouncer_test_project", "raw_payments"], "alias": "raw_payments", "checksum": {"name": "sha256", "checksum": "6de0626a8db9c1750eefd1b2e17fac4c2a4b9f778eb50532d8b377b90de395e6"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.7297914, "relation_name": "\"dbt\".\"main\".\"raw_payments\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "seed.dbt_bouncer_test_project.raw_customers": {"database": "dbt", "schema": "main", "name": "raw_customers", "resource_type": "seed", "package_name": "dbt_bouncer_test_project", "path": "raw_customers.csv", "original_file_path": "seeds/raw_customers.csv", "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "fqn": ["dbt_bouncer_test_project", "raw_customers"], "alias": "raw_customers", "checksum": {"name": "sha256", "checksum": "357d173dda65a741ad97d6683502286cc2655bb396ab5f4dfad12b8c39bd2a63"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "seed", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "delimiter": ",", "quote_columns": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449594.731127, "relation_name": "\"dbt\".\"main\".\"raw_customers\"", "raw_code": "", "root_path": "dbt_project", "depends_on": {"macros": []}}, "model.tiktok_ads.tiktok_ads__ad_group_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_group_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_group_report.sql", "original_file_path": "models/tiktok_ads__ad_group_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_group_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_group_report"], "alias": "tiktok_ads__ad_group_report", "checksum": {"name": "sha256", "checksum": "632cca1bf09a444564b0191f47cbf9b915abc122a33771101bf532022445adba"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad group level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2626848, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_group_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_group_report_hourly') }}\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n hourly.ad_group_id,\n ad_groups.ad_group_name,\n advertiser.currency, \n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_group_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ad_groups \n on hourly.ad_group_id = ad_groups.ad_group_id\n and hourly.source_relation = ad_groups.source_relation\n left join advertiser\n on ad_groups.advertiser_id = advertiser.advertiser_id\n and ad_groups.source_relation = advertiser.source_relation\n left join campaigns\n on ad_groups.campaign_id = campaigns.campaign_id\n and ad_groups.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(13) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__ad_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__ad_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__ad_report.sql", "original_file_path": "models/tiktok_ads__ad_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__ad_report", "fqn": ["tiktok_ads", "tiktok_ads__ad_report"], "alias": "tiktok_ads__ad_report", "checksum": {"name": "sha256", "checksum": "b6e44bf0fd46cf38a97e77939018234574ce2ac79aaf04be49d1c84ccab8e844"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the ad level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2616355, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__ad_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n),\n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n {{ dbt_utils.group_by(15) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__advertiser_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__advertiser_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__advertiser_report.sql", "original_file_path": "models/tiktok_ads__advertiser_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__advertiser_report", "fqn": ["tiktok_ads", "tiktok_ads__advertiser_report"], "alias": "tiktok_ads__advertiser_report", "checksum": {"name": "sha256", "checksum": "1a10a6276a75789dee9b7a93d0f28dead678944e65d4a2414155cdc32761ad80"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the account level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2588797, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__advertiser_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n),\n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\njoined as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ads.advertiser_id,\n advertiser.advertiser_name,\n advertiser.currency,\n sum(hourly.clicks) as clicks,\n sum(hourly.impressions) as impressions,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s, \n sum(hourly.video_watched_6_s) as video_watched_6_s, \n sum(hourly.video_views_p_25) as video_views_p_25, \n sum(hourly.video_views_p_50) as video_views_p_50,\n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(5) }}\n\n)\n\nselect *\nfrom joined", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__url_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__url_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__url_report.sql", "original_file_path": "models/tiktok_ads__url_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__url_report", "fqn": ["tiktok_ads", "tiktok_ads__url_report"], "alias": "tiktok_ads__url_report", "checksum": {"name": "sha256", "checksum": "f13afd947f065144756d205dbca162f146a9d03da149c33cca61c5037229390a"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance of ads at the URL level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.2661777, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__url_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('ad_report_hourly') }}\n), \n\nads as (\n\n select *\n from {{ var('ad_history') }}\n where is_most_recent_record\n), \n\nad_groups as (\n\n select *\n from {{ var('ad_group_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n ad_groups.advertiser_id,\n advertiser.advertiser_name,\n campaigns.campaign_id,\n campaigns.campaign_name,\n ad_groups.ad_group_id,\n ad_groups.ad_group_name,\n hourly.ad_id,\n ads.ad_name,\n ads.base_url,\n ads.url_host,\n ads.url_path,\n ads.utm_source,\n ads.utm_medium,\n ads.utm_campaign,\n ads.utm_content,\n ads.utm_term,\n advertiser.currency,\n ad_groups.category,\n ad_groups.gender,\n ad_groups.audience_type,\n ad_groups.budget,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__ad_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join ads\n on hourly.ad_id = ads.ad_id\n and hourly.source_relation = ads.source_relation\n left join ad_groups \n on ads.ad_group_id = ad_groups.ad_group_id\n and ads.source_relation = ad_groups.source_relation\n left join advertiser\n on ads.advertiser_id = advertiser.advertiser_id\n and ads.source_relation = advertiser.source_relation\n left join campaigns\n on ads.campaign_id = campaigns.campaign_id\n and ads.source_relation = campaigns.source_relation\n\n {% if var('ad_reporting__url_report__using_null_filter', True) %}\n -- We are filtering for only ads where url fields are populated.\n where ads.landing_page_url is not null\n {% endif %}\n\n {{ dbt_utils.group_by(23) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads.tiktok_ads__campaign_report": {"database": "dbt", "schema": "main_tiktok_ads", "name": "tiktok_ads__campaign_report", "resource_type": "model", "package_name": "tiktok_ads", "path": "tiktok_ads__campaign_report.sql", "original_file_path": "models/tiktok_ads__campaign_report.sql", "unique_id": "model.tiktok_ads.tiktok_ads__campaign_report", "fqn": ["tiktok_ads", "tiktok_ads__campaign_report"], "alias": "tiktok_ads__campaign_report", "checksum": {"name": "sha256", "checksum": "65428adb314b3bb0f77e9f3df4705c1b0de4732b0894578c6936bdecfc8e541d"}, "config": {"enabled": true, "alias": null, "schema": "tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record in this table represents the daily performance at the campaign level.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "date_day": {"name": "date_day", "description": "Day of record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Advertiser's currency.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of impressions that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The amount of spend that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of follows that occurred on the day of the record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpc": {"name": "daily_cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_cpm": {"name": "daily_cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "daily_ctr": {"name": "daily_ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads://models/tiktok_ads.yml", "build_path": null, "unrendered_config": {"schema": "tiktok_ads", "materialized": "table", "enabled": true}, "created_at": 1723449595.263526, "relation_name": "\"dbt\".\"main_tiktok_ads\".\"tiktok_ads__campaign_report\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith hourly as (\n \n select *\n from {{ var('campaign_report_hourly') }}\n), \n\ncampaigns as (\n\n select *\n from {{ var('campaign_history') }}\n where is_most_recent_record\n), \n\nadvertiser as (\n\n select *\n from {{ var('advertiser') }}\n), \n\naggregated as (\n\n select\n hourly.source_relation,\n cast(hourly.stat_time_hour as date) as date_day,\n advertiser.advertiser_id,\n advertiser.advertiser_name,\n hourly.campaign_id,\n campaigns.campaign_name,\n advertiser.currency,\n sum(hourly.impressions) as impressions,\n sum(hourly.clicks) as clicks,\n sum(hourly.spend) as spend,\n sum(hourly.reach) as reach,\n sum(hourly.conversion) as conversion,\n sum(hourly.likes) as likes,\n sum(hourly.comments) as comments,\n sum(hourly.shares) as shares,\n sum(hourly.profile_visits) as profile_visits,\n sum(hourly.follows) as follows,\n sum(hourly.video_watched_2_s) as video_watched_2_s,\n sum(hourly.video_watched_6_s) as video_watched_6_s,\n sum(hourly.video_views_p_25) as video_views_p_25,\n sum(hourly.video_views_p_50) as video_views_p_50, \n sum(hourly.video_views_p_75) as video_views_p_75,\n sum(hourly.spend)/nullif(sum(hourly.clicks),0) as daily_cpc,\n (sum(hourly.spend)/nullif(sum(hourly.impressions),0))*1000 as daily_cpm,\n (sum(hourly.clicks)/nullif(sum(hourly.impressions),0))*100 as daily_ctr\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='tiktok_ads__campaign_hourly_passthrough_metrics', transform = 'sum') }}\n \n from hourly\n left join campaigns\n on hourly.campaign_id = campaigns.campaign_id\n and hourly.source_relation = campaigns.source_relation\n left join advertiser\n on campaigns.advertiser_id = advertiser.advertiser_id\n and campaigns.source_relation = advertiser.source_relation\n {{ dbt_utils.group_by(7) }}\n\n)\n\nselect *\nfrom aggregated", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.dbt_utils.group_by"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__campaign_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_report_hourly"], "alias": "stg_tiktok_ads__campaign_report_hourly", "checksum": {"name": "sha256", "checksum": "16b447b1ccc556275104378b55f4a0eacbe9c42ce4084ca4b2edd3c078ea6c34"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represent data for each campaign for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3358166, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_report_hourly_tmp')),\n staging_columns=get_campaign_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour,\n cpc, \n cpm,\n ctr,\n impressions,\n clicks,\n spend,\n reach,\n conversion,\n cost_per_conversion,\n conversion_rate,\n likes,\n comments,\n shares,\n profile_visits,\n follows,\n video_play_actions,\n video_watched_2_s,\n video_watched_6_s,\n video_views_p_25,\n video_views_p_50,\n video_views_p_75,\n average_video_play,\n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__campaign_hourly_passthrough_metrics') }}\n \n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_history"], "alias": "stg_tiktok_ads__ad_group_history", "checksum": {"name": "sha256", "checksum": "349e2e224ca0839dc64bde965726aae74756b1b228ff06ad90ec178f7a2e9cb1"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "Action days", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_name": {"name": "ad_group_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category": {"name": "interest_category", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3317177, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_history_tmp')),\n staging_columns=get_ad_group_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation,\n adgroup_id as ad_group_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_id,\n action_days,\n action_categories,\n adgroup_name as ad_group_name,\n coalesce(age_groups, age) as age_groups,\n audience_type,\n budget,\n category,\n display_name,\n interest_category_v_2 as interest_category,\n frequency,\n frequency_schedule,\n gender,\n languages, \n landing_page_url,\n row_number() over (partition by source_relation, adgroup_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_history.sql", "original_file_path": "models/stg_tiktok_ads__ad_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_history"], "alias": "stg_tiktok_ads__ad_history", "checksum": {"name": "sha256", "checksum": "366a9f7f32faff70cbb98e3a4f4280c023c0913c956fe2890bacefbb13e0674c"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "base_url": {"name": "base_url", "description": "The base URL of the ad, extracted from the `landing page url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_host": {"name": "url_host", "description": "The URL host of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "url_path": {"name": "url_path", "description": "The URL path of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_source": {"name": "utm_source", "description": "The utm_source parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_medium": {"name": "utm_medium", "description": "The utm_medium parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_campaign": {"name": "utm_campaign", "description": "The utm_campaign parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_content": {"name": "utm_content", "description": "The utm_content parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "utm_term": {"name": "utm_term", "description": "The utm_term parameter of the ad, extracted from the `landing_page_url`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3325214, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_history_tmp')),\n staging_columns=get_ad_history_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n adgroup_id as ad_group_id,\n advertiser_id,\n campaign_id,\n ad_name,\n call_to_action,\n click_tracking_url,\n impression_tracking_url,\n {{ dbt.split_part('landing_page_url', \"'?'\", 1) }} as base_url,\n {{ dbt_utils.get_url_host('landing_page_url') }} as url_host,\n '/' || {{ dbt_utils.get_url_path('landing_page_url') }} as url_path,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_source') }} as utm_source,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_medium') }} as utm_medium,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_campaign') }} as utm_campaign,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_content') }} as utm_content,\n {{ tiktok_ads_source.tiktok_ads_extract_url_parameter('landing_page_url', 'utm_term') }} as utm_term,\n landing_page_url,\n row_number() over (partition by source_relation, ad_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.dbt.split_part", "macro.dbt_utils.get_url_host", "macro.dbt_utils.get_url_path", "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__campaign_history.sql", "original_file_path": "models/stg_tiktok_ads__campaign_history.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__campaign_history"], "alias": "stg_tiktok_ads__campaign_history", "checksum": {"name": "sha256", "checksum": "3ea23a6b39aec6781f4fc1d4d47bf74f479ef708034d3e04be8125c4d26c2e36"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each campaign.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_most_recent_record": {"name": "is_most_recent_record", "description": "Whether record is the most recent one for this particular grain.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.333019, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__campaign_history_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__campaign_history_tmp')),\n staging_columns=get_campaign_history_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n campaign_id,\n cast(updated_at as {{ dbt.type_timestamp() }}) as updated_at,\n advertiser_id,\n campaign_name,\n campaign_type,\n split_test_variable,\n row_number() over (partition by source_relation, campaign_id order by updated_at desc) = 1 as is_most_recent_record\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__campaign_history_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_campaign_history_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_report_hourly"], "alias": "stg_tiktok_ads__ad_report_hourly", "checksum": {"name": "sha256", "checksum": "af14d4be44964072d467f3a7798ce81aa23eaa4cdd49cb5465921483fc710c47"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.333927, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_report_hourly_tmp')),\n staging_columns=get_ad_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n ad_id, \n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_hourly_passthrough_metrics') }}\n from fields\n)\n\nselect * \nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__advertiser.sql", "original_file_path": "models/stg_tiktok_ads__advertiser.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__advertiser"], "alias": "stg_tiktok_ads__advertiser", "checksum": {"name": "sha256", "checksum": "f8b5e247fa25556620ed659ae7de05e559ffbfa05cd0788c583bd3ae4256b401"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each advertiser.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_name": {"name": "advertiser_name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3306043, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__advertiser_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__advertiser_tmp')),\n staging_columns=get_advertiser_columns()\n )\n }}\n\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n),\n\nfinal as (\n\n select\n source_relation, \n id as advertiser_id, \n address, \n balance, \n company, \n contacter, \n country, \n currency, \n description, \n email, \n industry, \n language,\n name as advertiser_name, \n coalesce(cellphone_number, phone_number) as cellphone_number, \n coalesce(telephone_number, telephone) as telephone_number,\n timezone\n from fields\n)\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__advertiser_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_advertiser_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "stg_tiktok_ads__ad_group_report_hourly.sql", "original_file_path": "models/stg_tiktok_ads__ad_group_report_hourly.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "fqn": ["tiktok_ads_source", "stg_tiktok_ads__ad_group_report_hourly"], "alias": "stg_tiktok_ads__ad_group_report_hourly", "checksum": {"name": "sha256", "checksum": "07a491825cd0f0884c4fcbb3482ed94e4bcc63b8f62976b92823068823edde43"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Each record represents data for each ad group for each hour.", "columns": {"source_relation": {"name": "source_relation", "description": "The source of the record if the unioning functionality is being used. If not this field will be empty.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_group_id": {"name": "ad_group_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time per user your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "tiktok_ads_source://models/stg_tiktok_ads.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449595.3348942, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\nwith base as (\n\n select *\n from {{ ref('stg_tiktok_ads__ad_group_report_hourly_tmp') }}\n), \n\nfields as (\n\n select\n {{\n fivetran_utils.fill_staging_columns(\n source_columns=adapter.get_columns_in_relation(ref('stg_tiktok_ads__ad_group_report_hourly_tmp')),\n staging_columns=get_ad_group_report_hourly_columns()\n )\n }}\n \n {{ fivetran_utils.source_relation(\n union_schema_variable='tiktok_ads_union_schemas', \n union_database_variable='tiktok_ads_union_databases') \n }}\n\n from base\n), \n\nfinal as (\n\n select\n source_relation, \n adgroup_id as ad_group_id,\n cast(stat_time_hour as {{ dbt.type_timestamp() }}) as stat_time_hour, \n cpc, \n cpm, \n ctr, \n impressions, \n clicks, \n spend, \n reach, \n conversion, \n cost_per_conversion, \n conversion_rate, \n likes, \n comments, \n shares, \n profile_visits,\n follows, \n video_play_actions, \n video_watched_2_s, \n video_watched_6_s, \n video_views_p_25, \n video_views_p_50,\n video_views_p_75, \n average_video_play, \n average_video_play_per_user\n\n {{ fivetran_utils.fill_pass_through_columns('tiktok_ads__ad_group_hourly_passthrough_metrics') }}\n\n from fields\n) \n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}, {"name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro.fivetran_utils.fill_staging_columns", "macro.fivetran_utils.source_relation", "macro.dbt.type_timestamp", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "d814023272131a2935e529ce3d3cd8f97e28bcc142b27f0cbf8cc281889b9400"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9028952, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_report_hourly"], ["tiktok_ads", "ad_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_report_hourly_tmp"], "alias": "stg_tiktok_ads__campaign_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "2ba1f021a1b7d5713f191cd109e848d506dd1f5551997483d3359859452c3e5a"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9234703, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_report_hourly"], ["tiktok_ads", "campaign_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_report_hourly_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_report_hourly_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_report_hourly_tmp"], "alias": "stg_tiktok_ads__ad_group_report_hourly_tmp", "checksum": {"name": "sha256", "checksum": "487acd70d5715c9f881780bc93c5cb4f011c4fa651ca7182d3109fbf7f0be055"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9272459, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_report_hourly_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_report_hourly', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_report_hourly',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_report_hourly"], ["tiktok_ads", "adgroup_report_hourly"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_group_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_group_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_group_history_tmp"], "alias": "stg_tiktok_ads__ad_group_history_tmp", "checksum": {"name": "sha256", "checksum": "500dc2e29e27a02a4f259d87063cf556d69b605a34d43eab7d6a5cf4fc18f303"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9310117, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_group_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='adgroup_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='adgroup_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "adgroup_history"], ["tiktok_ads", "adgroup_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__campaign_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__campaign_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__campaign_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__campaign_history_tmp"], "alias": "stg_tiktok_ads__campaign_history_tmp", "checksum": {"name": "sha256", "checksum": "d03040995c56c71b1e8348a27eaf677b13e3d2d5e6c8220ee0aa7dc283ce0396"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9351516, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__campaign_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='campaign_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='campaign_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "campaign_history"], ["tiktok_ads", "campaign_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__advertiser_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__advertiser_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__advertiser_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__advertiser_tmp"], "alias": "stg_tiktok_ads__advertiser_tmp", "checksum": {"name": "sha256", "checksum": "5e7939bfa9f2faf4d8b83626a7fb9e43bbbe764da901a724dcb7041ad87f796e"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.9388435, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__advertiser_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='advertiser', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='advertiser',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "advertiser"], ["tiktok_ads", "advertiser"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": {"database": "dbt", "schema": "main_stg_tiktok_ads", "name": "stg_tiktok_ads__ad_history_tmp", "resource_type": "model", "package_name": "tiktok_ads_source", "path": "tmp/stg_tiktok_ads__ad_history_tmp.sql", "original_file_path": "models/tmp/stg_tiktok_ads__ad_history_tmp.sql", "unique_id": "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp", "fqn": ["tiktok_ads_source", "tmp", "stg_tiktok_ads__ad_history_tmp"], "alias": "stg_tiktok_ads__ad_history_tmp", "checksum": {"name": "sha256", "checksum": "d302caf66e9dae0aa86dd7a4bd5dc2d494246f66ca1b3017fa941135d4fcfb07"}, "config": {"enabled": true, "alias": null, "schema": "stg_tiktok_ads", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "view", "schema": "stg_tiktok_ads", "enabled": true}, "created_at": 1723449594.942528, "relation_name": "\"dbt\".\"main_stg_tiktok_ads\".\"stg_tiktok_ads__ad_history_tmp\"", "raw_code": "{{ config(enabled=var('ad_reporting__tiktok_ads_enabled', true)) }}\n\n{{\n fivetran_utils.union_data(\n table_identifier='ad_history', \n database_variable='tiktok_ads_database', \n schema_variable='tiktok_ads_schema', \n default_database=target.database,\n default_schema='tiktok_ads',\n default_variable='ad_history',\n union_schema_variable='tiktok_ads_union_schemas',\n union_database_variable='tiktok_ads_union_databases'\n )\n}}", "language": "sql", "refs": [], "sources": [["tiktok_ads", "ad_history"], ["tiktok_ads", "ad_history"]], "metrics": [], "depends_on": {"macros": ["macro.fivetran_utils.union_data"], "nodes": ["source.tiktok_ads_source.tiktok_ads.ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "unique_stg_payments_payment_id"], "alias": "unique_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.163656, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/unique_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "unique", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_payments_payment_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_payments_payment_id.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "not_null_stg_payments_payment_id"], "alias": "not_null_stg_payments_payment_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.164794, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/not_null_stg_payments_payment_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_id", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "payment_id", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "original_file_path": "models/staging/payments/_stg_payments__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card"], "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef"}, "created_at": 1723449595.1658564, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", "language": "sql", "refs": [{"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/payments/_stg_payments__models.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "payment_method", "file_key_name": "models.stg_payments", "attached_node": "model.dbt_bouncer_test_project.stg_payments", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["credit_card", "coupon", "bank_transfer", "gift_card"], "column_name": "payment_method", "model": "{{ get_where_subquery(ref('stg_payments')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_orders_order_id"], "alias": "unique_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1854324, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_orders_order_id"], "alias": "not_null_stg_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1863756, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58"}, "created_at": 1723449595.187339, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", "language": "sql", "refs": [{"name": "stg_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.stg_orders", "attached_node": "model.dbt_bouncer_test_project.stg_orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('stg_orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "values_below_threshold_int_model_1_id__10", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "values_below_threshold_int_model_1_id__10.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "values_below_threshold_int_model_1_id__10"], "alias": "values_below_threshold_int_model_1_id__10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1922855, "relation_name": null, "raw_code": "{{ test_values_below_threshold(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_bouncer_test_project.test_values_below_threshold", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/values_below_threshold_int_model_1_id__10.sql", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "values_below_threshold", "kwargs": {"threshold": 10, "column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_int_model_1_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_int_model_1_id.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "not_null_int_model_1_id"], "alias": "not_null_int_model_1_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.1949291, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/not_null_int_model_1_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "id", "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "id", "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name"], "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712"}, "created_at": 1723449595.1957488, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712\") }}", "language": "sql", "refs": [{"name": "int_model_1", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_model_1"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_292d1b391194a957ac83fe06fc688712.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_model_1", "sql": " __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_model_1", "attached_node": "model.dbt_bouncer_test_project.int_model_1", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_model_1')) }}"}, "namespace": "dbt_expectations"}}, "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_orders_order_id"], "alias": "unique_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2253199, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_order_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_order_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_order_id"], "alias": "not_null_orders_order_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2261689, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_order_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "order_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_customer_id"], "alias": "not_null_orders_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2269843, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "relationships_orders_customer_id__customer_id__ref_customers_", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "relationships_orders_customer_id__customer_id__ref_customers_.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "relationships_orders_customer_id__customer_id__ref_customers_"], "alias": "relationships_orders_customer_id__customer_id__ref_customers_", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2278244, "relation_name": null, "raw_code": "{{ test_relationships(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}, {"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_relationships", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/relationships_orders_customer_id__customer_id__ref_customers_.sql", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "relationships", "kwargs": {"to": "ref('customers')", "field": "customer_id", "column_name": "customer_id", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "accepted_values_orders_status__placed__shipped__completed__return_pending__returned", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "accepted_values_orders_status__placed__shipped__completed__return_pending__returned"], "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758"}, "created_at": 1723449595.231973, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_accepted_values", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "status", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "accepted_values", "kwargs": {"values": ["placed", "shipped", "completed", "return_pending", "returned"], "column_name": "status", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_amount"], "alias": "not_null_orders_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2343636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_credit_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_credit_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_credit_card_amount"], "alias": "not_null_orders_credit_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2352116, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_credit_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "credit_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "credit_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_coupon_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_coupon_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_coupon_amount"], "alias": "not_null_orders_coupon_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2360294, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_coupon_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "coupon_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "coupon_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_bank_transfer_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_bank_transfer_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_bank_transfer_amount"], "alias": "not_null_orders_bank_transfer_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2368486, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_bank_transfer_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "bank_transfer_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "bank_transfer_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_orders_gift_card_amount", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_orders_gift_card_amount.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_orders_gift_card_amount"], "alias": "not_null_orders_gift_card_amount", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2376633, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_orders_gift_card_amount.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "gift_card_amount", "file_key_name": "models.orders", "attached_node": "model.dbt_bouncer_test_project.orders", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "gift_card_amount", "model": "{{ get_where_subquery(ref('orders')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_date_day"], "alias": "not_null_tiktok_ads__advertiser_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2667127, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__advertiser_report_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__advertiser_report_advertiser_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "fqn": ["tiktok_ads", "not_null_tiktok_ads__advertiser_report_advertiser_id"], "alias": "not_null_tiktok_ads__advertiser_report_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2676814, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df"}, "created_at": 1723449595.2685745, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_140f770f737e1536979813abf05995df\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__advertiser_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__advertiser_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__advertiser_report", "attached_node": "model.tiktok_ads.tiktok_ads__advertiser_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__advertiser_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_date_day"], "alias": "not_null_tiktok_ads__ad_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.27404, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_report_ad_id"], "alias": "not_null_tiktok_ads__ad_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2748637, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4"}, "created_at": 1723449595.2756917, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_07c2675cf1cf332b94992557f4d839f4\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_date_day"], "alias": "not_null_tiktok_ads__ad_group_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2781255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__ad_group_report_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__ad_group_report_ad_group_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "fqn": ["tiktok_ads", "not_null_tiktok_ads__ad_group_report_ad_group_id"], "alias": "not_null_tiktok_ads__ad_group_report_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.279022, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989"}, "created_at": 1723449595.280099, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_d355d65e29e6861aa224ba04f4e7a989\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__ad_group_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__ad_group_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__ad_group_report", "attached_node": "model.tiktok_ads.tiktok_ads__ad_group_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__ad_group_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_date_day"], "alias": "not_null_tiktok_ads__campaign_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2827075, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__campaign_report_campaign_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__campaign_report_campaign_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "fqn": ["tiktok_ads", "not_null_tiktok_ads__campaign_report_campaign_id"], "alias": "not_null_tiktok_ads__campaign_report_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2836335, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363"}, "created_at": 1723449595.2845573, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_0d0d412752932f69c282547f17119363\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__campaign_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__campaign_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__campaign_report", "attached_node": "model.tiktok_ads.tiktok_ads__campaign_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__campaign_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_date_day.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_date_day"], "alias": "not_null_tiktok_ads__url_report_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2873259, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_ad_id", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_ad_id.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_ad_id"], "alias": "not_null_tiktok_ads__url_report_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.2881603, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_tiktok_ads__url_report_base_url", "resource_type": "test", "package_name": "tiktok_ads", "path": "not_null_tiktok_ads__url_report_base_url.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "fqn": ["tiktok_ads", "not_null_tiktok_ads__url_report_base_url"], "alias": "not_null_tiktok_ads__url_report_base_url", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true}, "created_at": 1723449595.2893775, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(enabled=True) }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "base_url", "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "base_url", "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": null}}, "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day", "resource_type": "test", "package_name": "tiktok_ads", "path": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec.sql", "original_file_path": "models/tiktok_ads.yml", "unique_id": "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "fqn": ["tiktok_ads", "dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day"], "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec"}, "created_at": 1723449595.290719, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(enabled=True,alias=\"dbt_utils_unique_combination_o_177663ef68046a7cc077e14a1b22e5ec\") }}", "language": "sql", "refs": [{"name": "tiktok_ads__url_report", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads.tiktok_ads__url_report"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.tiktok_ads__url_report", "attached_node": "model.tiktok_ads.tiktok_ads__url_report", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "ad_group_id", "campaign_id", "advertiser_id", "date_day"], "model": "{{ get_where_subquery(ref('tiktok_ads__url_report')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__advertiser_advertiser_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__advertiser_advertiser_id"], "alias": "not_null_stg_tiktok_ads__advertiser_advertiser_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3363645, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "advertiser_id", "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "advertiser_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id"], "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e"}, "created_at": 1723449595.3373928, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e7e88f3f497325405be05932f37ea2e\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__advertiser", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__advertiser", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "advertiser_id"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__advertiser')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_history_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_history_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3397474, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at"], "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77"}, "created_at": 1723449595.340602, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_2ce2e8d20e561240fd8236ce15212a77\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_history_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_history_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_history_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_history_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.342983, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at"], "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9"}, "created_at": 1723449595.3438327, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_3e79eabd58ab858677e7781a46e7d8b9\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_history_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_history_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_history_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3466344, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at"], "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f"}, "created_at": 1723449595.3475626, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_7aab7ed41249c473b67c95735fdd521f\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_history", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_history", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "updated_at"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_history')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_ad_id"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_ad_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3498516, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_id", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.350876, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0"}, "created_at": 1723449595.3517792, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_e6060e94140e3a6953ae3700b1fabae0\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3541522, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "ad_group_id", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "ad_group_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.3551278, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10"}, "created_at": 1723449595.3559504, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_c2666a445415f25f1fd55b9540f98d10\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__ad_group_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__ad_group_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "ad_group_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__ad_group_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.358131, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c", "fqn": ["tiktok_ads_source", "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour"], "alias": "not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723449595.35906, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "stat_time_hour", "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "stat_time_hour", "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": null}}, "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour", "resource_type": "test", "package_name": "tiktok_ads_source", "path": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28.sql", "original_file_path": "models/stg_tiktok_ads.yml", "unique_id": "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "fqn": ["tiktok_ads_source", "dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour"], "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28"}, "created_at": 1723449595.3598816, "relation_name": null, "raw_code": "{{ dbt_utils.test_unique_combination_of_columns(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_utils_unique_combination_o_db7f8f91773e74d564ab66f9f0497b28\") }}", "language": "sql", "refs": [{"name": "stg_tiktok_ads__campaign_report_hourly", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_utils.test_unique_combination_of_columns", "macro.dbt.get_where_subquery"], "nodes": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"]}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.stg_tiktok_ads__campaign_report_hourly", "attached_node": "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly", "test_metadata": {"name": "unique_combination_of_columns", "kwargs": {"combination_of_columns": ["source_relation", "campaign_id", "stat_time_hour"], "model": "{{ get_where_subquery(ref('stg_tiktok_ads__campaign_report_hourly')) }}"}, "namespace": "dbt_utils"}}, "model.dbt_bouncer_test_project.stg_customers": {"database": "dbt", "schema": "main", "name": "stg_customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "staging/crm/stg_customers.sql", "original_file_path": "models/staging/crm/stg_customers.sql", "unique_id": "model.dbt_bouncer_test_project.stg_customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "stg_customers"], "alias": "stg_customers", "checksum": {"name": "sha256", "checksum": "aa3d91f51d2920353d5ac1a5fbbbc54b5cf265f934abec8ffeb8a1dcdbe42c77"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": ["crm"], "meta": {"maturity": "gold"}, "group": null, "materialized": "view", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": ["crm"], "description": "Staging table for customer data.", "columns": {"customer_id": {"name": "customer_id", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/staging/crm/_stg_crm__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "tags": ["crm"], "meta": {"maturity": "gold"}}, "created_at": 1723450347.7217855, "relation_name": "\"dbt\".\"main\".\"stg_customers\"", "raw_code": "with\n source as (\n\n {#-\n Normally we would select from the table here, but we are using seeds to load\n our data in this project\n #}\n select *\n from {{ ref(\"raw_customers\") }}\n\n union distinct\n\n select *\n from {{ source(\"dummy_source\", \"customers\") }}\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "language": "sql", "refs": [{"name": "raw_customers", "package": null, "version": null}], "sources": [["dummy_source", "customers"]], "metrics": [], "depends_on": {"macros": [], "nodes": ["source.dbt_bouncer_test_project.dummy_source.customers", "seed.dbt_bouncer_test_project.raw_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/stg_customers.sql", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "unique_stg_customers_customer_id"], "alias": "unique_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723450347.7841606, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/unique_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/crm/_stg_crm__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "not_null_stg_customers_customer_id"], "alias": "not_null_stg_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1723450347.7853687, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.stg_customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/staging/crm/_stg_crm__models.yml/not_null_stg_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.stg_customers", "attached_node": "model.dbt_bouncer_test_project.stg_customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('stg_customers')) }}"}, "namespace": null}}, "model.dbt_bouncer_test_project.int_disabled_model": {"database": "dbt", "schema": "main", "name": "int_disabled_model", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "intermediate/finance/int_disabled_model.sql", "original_file_path": "models/intermediate/finance/int_disabled_model.sql", "unique_id": "model.dbt_bouncer_test_project.int_disabled_model", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "int_disabled_model"], "alias": "int_disabled_model", "checksum": {"name": "sha256", "checksum": "fc784782b7863364308823df9e06552dbcfa6658e3df2adedd9a44a4f054b385"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "lead"}, "group": null, "materialized": "ephemeral", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "A disabled model to be more representative of a real dbt project.", "columns": {}, "meta": {"maturity": "lead"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/intermediate/finance/_int_finance__models.yml", "build_path": null, "unrendered_config": {"access": "protected", "meta": {"maturity": "lead"}, "materialized": "ephemeral"}, "created_at": 1724136615.6139448, "relation_name": null, "raw_code": "{{ config(materialized=\"ephemeral\") }} select 1 as id, 'Anna' as name", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/int_disabled_model.sql", "compiled": true, "compiled_code": " select 1 as id, 'Anna' as name", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "original_file_path": "models/intermediate/finance/_int_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "fqn": ["dbt_bouncer_test_project", "intermediate", "finance", "dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name"], "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871", "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"alias": "dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871"}, "created_at": 1724136615.6811168, "relation_name": null, "raw_code": "{{ dbt_expectations.test_expect_compound_columns_to_be_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871\") }}", "language": "sql", "refs": [{"name": "int_disabled_model", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.int_disabled_model"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/intermediate/finance/_int_finance__models.yml/dbt_expectations_expect_compou_a1f24320350077850426ffdf23a47871.sql", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "extra_ctes_injected": true, "extra_ctes": [{"id": "model.dbt_bouncer_test_project.int_disabled_model", "sql": " __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n)"}], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": null, "file_key_name": "models.int_disabled_model", "attached_node": "model.dbt_bouncer_test_project.int_disabled_model", "test_metadata": {"name": "expect_compound_columns_to_be_unique", "kwargs": {"column_list": ["id", "name"], "model": "{{ get_where_subquery(ref('int_disabled_model')) }}"}, "namespace": "dbt_expectations"}}, "model.dbt_bouncer_test_project.customers": {"database": "dbt", "schema": "main", "name": "customers", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/customers.sql", "original_file_path": "models/marts/finance/customers.sql", "unique_id": "model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "alias": "customers", "checksum": {"name": "sha256", "checksum": "d09c4049741ff2ef61bdafb030ba718ad6e44b6b1492fed490d19545cdd1b5d9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "gold"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": true, "alias_types": true}, "access": "public"}, "tags": [], "description": "This table has basic information about a customer, as well as some derived facts based on a customer's orders", "columns": {"customer_id": {"name": "customer_id", "description": "This is a unique identifier for a customer", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "first_name": {"name": "first_name", "description": "Customer's first name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "last_name": {"name": "last_name", "description": "Customer's last name. PII.", "meta": {}, "data_type": "string", "constraints": [], "quote": null, "tags": []}, "first_order_date": {"name": "first_order_date", "description": "Date (UTC) of a customer's first order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "most_recent_order_date": {"name": "most_recent_order_date", "description": "Date (UTC) of a customer's most recent order", "meta": {}, "data_type": "date", "constraints": [], "quote": null, "tags": []}, "number_of_orders": {"name": "number_of_orders", "description": "Count of the number of orders a customer has placed", "meta": {}, "data_type": "bigint", "constraints": [], "quote": null, "tags": []}, "is_recurring_customer": {"name": "is_recurring_customer", "description": "Boolean indicating whether a customer has placed more than five orders", "meta": {}, "data_type": "boolean", "constraints": [], "quote": null, "tags": []}, "customer_lifetime_value": {"name": "customer_lifetime_value", "description": "Sum of all payments a customer has made", "meta": {}, "data_type": "double", "constraints": [], "quote": null, "tags": []}}, "meta": {"maturity": "gold"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/marts/finance/_finance__models.yml", "build_path": null, "unrendered_config": {"access": "public", "contract": {"enforced": true}, "meta": {"maturity": "gold"}, "materialized": "table"}, "created_at": 1724602100.2547586, "relation_name": "\"dbt\".\"main\".\"customers\"", "raw_code": "{{ config(materialized=\"table\") }}\n\nwith\n customers as (select * from {{ ref(\"stg_customers\") }}),\n\n orders as (select * from {{ ref(\"stg_orders\") }}),\n\n payments as (select * from {{ ref(\"stg_payments\") }}),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "language": "sql", "refs": [{"name": "stg_customers", "package": null, "version": null}, {"name": "stg_orders", "package": null, "version": null}, {"name": "stg_payments", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/customers.sql", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": true, "alias_types": true, "checksum": "a641f5cec4c2df441eff20aef152591fbd9aa2988792da9974c896d996168bec"}, "access": "public", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "unique_customers_customer_id"], "alias": "unique_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3198235, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/unique_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "unique", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_customer_id", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_customer_id.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_customer_id"], "alias": "not_null_customers_customer_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3210306, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_customer_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "customer_id", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "customer_id", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_customers_is_recurring_customer", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_customers_is_recurring_customer.sql", "original_file_path": "models/marts/finance/_finance__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "not_null_customers_is_recurring_customer"], "alias": "not_null_customers_is_recurring_customer", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1724602100.3220053, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/marts/finance/_finance__models.yml/not_null_customers_is_recurring_customer.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "is_recurring_customer", "file_key_name": "models.customers", "attached_node": "model.dbt_bouncer_test_project.customers", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "is_recurring_customer", "model": "{{ get_where_subquery(ref('customers')) }}"}, "namespace": null}}, "model.dbt_bouncer_test_project.metricflow_time_spine": {"database": "dbt", "schema": "main", "name": "metricflow_time_spine", "resource_type": "model", "package_name": "dbt_bouncer_test_project", "path": "utilities/time_spines/metricflow_time_spine.sql", "original_file_path": "models/utilities/time_spines/metricflow_time_spine.sql", "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "metricflow_time_spine"], "alias": "metricflow_time_spine", "checksum": {"name": "sha256", "checksum": "174d9e194fa1eb8b73a29ee9c6ca44f00f7931a6b482d5d76c331f32b1ee5ee9"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {"maturity": "experimental"}, "group": null, "materialized": "table", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "access": "protected"}, "tags": [], "description": "Mandatory model for our semantic models.", "columns": {"date_day": {"name": "date_day", "description": "", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": [], "granularity": "day"}}, "meta": {"maturity": "experimental"}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://models/utilities/time_spines/_utilities_time_spines__models.yml", "build_path": null, "unrendered_config": {"meta": {"maturity": "experimental"}, "materialized": "table"}, "created_at": 1725381781.894404, "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\"", "raw_code": "{{\n config(\n materialized=\"table\",\n )\n}}\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/metricflow_time_spine.sql", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null}, "test.dbt_bouncer_test_project.test_assert_something": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "test_assert_something", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "test_assert_something.sql", "original_file_path": "tests/test_assert_something.sql", "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "fqn": ["dbt_bouncer_test_project", "test_assert_something"], "alias": "test_assert_something", "checksum": {"name": "sha256", "checksum": "9bc4003df17014cec1c055afb67a657777bdcc2c94e7a8217e0994f59701fd64"}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.821509, "relation_name": null, "raw_code": "select * from (select 1 as id) where id > 1", "language": "sql", "refs": [], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/tests/test_assert_something.sql", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}, "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "not_null_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "not_null_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "not_null_metricflow_time_spine_date_day"], "alias": "not_null_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.9449537, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/not_null_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": {"database": "dbt", "schema": "main_dbt_test__audit", "name": "unique_metricflow_time_spine_date_day", "resource_type": "test", "package_name": "dbt_bouncer_test_project", "path": "unique_metricflow_time_spine_date_day.sql", "original_file_path": "models/utilities/time_spines/_utilities_time_spines__models.yml", "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "fqn": ["dbt_bouncer_test_project", "utilities", "time_spines", "unique_metricflow_time_spine_date_day"], "alias": "unique_metricflow_time_spine_date_day", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 0", "error_if": "!= 0"}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {}, "created_at": 1725381781.9466112, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [{"name": "metricflow_time_spine", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.dbt_bouncer_test_project.metricflow_time_spine"]}, "compiled_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target/compiled/dbt_bouncer_test_project/models/utilities/time_spines/_utilities_time_spines__models.yml/unique_metricflow_time_spine_date_day.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "date_day", "file_key_name": "models.metricflow_time_spine", "attached_node": "model.dbt_bouncer_test_project.metricflow_time_spine", "test_metadata": {"name": "unique", "kwargs": {"column_name": "date_day", "model": "{{ get_where_subquery(ref('metricflow_time_spine')) }}"}, "namespace": null}}, "snapshot.dbt_bouncer_test_project.orders_snapshot": {"database": "dbt", "schema": "dbt_pslattery", "name": "orders_snapshot", "resource_type": "snapshot", "package_name": "dbt_bouncer_test_project", "path": "orders_snapshot.sql", "original_file_path": "snapshots/orders_snapshot.sql", "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "fqn": ["dbt_bouncer_test_project", "orders_snapshot", "orders_snapshot"], "alias": "orders_snapshot", "checksum": {"name": "sha256", "checksum": "2337b7104659955eb2d350e6b0a09ba3bdc6c6836ab1b6aebaf91e2ec75c1e8f"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "materialized": "snapshot", "incremental_strategy": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "id", "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "strategy": "timestamp", "target_schema": "dbt_pslattery", "target_database": "dbt", "updated_at": "order_date", "check_cols": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"target_database": "dbt", "target_schema": "dbt_pslattery", "unique_key": "id", "strategy": "timestamp", "updated_at": "order_date"}, "created_at": 1727257247.523739, "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\"", "raw_code": "\n\n {{\n config(\n target_database='dbt' if target.type == 'duckdb' else 'padraic-slattery-sndbx-o',\n target_schema=\"dbt_pslattery\",\n unique_key=\"id\",\n strategy=\"timestamp\",\n updated_at=\"order_date\",\n )\n }}\n\n select *\n from {{ ref(\"raw_orders\") }}\n\n", "language": "sql", "refs": [{"name": "raw_orders", "package": null, "version": null}], "sources": [], "metrics": [], "depends_on": {"macros": [], "nodes": ["seed.dbt_bouncer_test_project.raw_orders"]}, "compiled_path": null, "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}}}, "sources": {"source.tiktok_ads_source.tiktok_ads.advertiser": {"database": "dbt", "schema": "tiktok_ads", "name": "advertiser", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.advertiser", "fqn": ["tiktok_ads_source", "tiktok_ads", "advertiser"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "advertiser", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for one advertiser.", "columns": {"id": {"name": "id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "address": {"name": "address", "description": "Advertiser address information", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "balance": {"name": "balance", "description": "Account available balance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cellphone_number": {"name": "cellphone_number", "description": "Contact mobile number, desensitised data. This is the newest version of the field `phone_number`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "company": {"name": "company", "description": "Advertiser's company name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "contacter": {"name": "contacter", "description": "Contact Person", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "country": {"name": "country", "description": "The advertiser's country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Advertiser's create time", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "currency": {"name": "currency", "description": "Type of currency used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "description": {"name": "description", "description": "Brand description, i.e. promotional content", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "email": {"name": "email", "description": "Advertiser contact email, desensitised data", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "industry": {"name": "industry", "description": "Advertiser industry category", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "language": {"name": "language", "description": "Language used by advertisers", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_no": {"name": "license_no", "description": "License number", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "license_url": {"name": "license_url", "description": "License preview address, the link is valid for an hour by default.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "name": {"name": "name", "description": "Advertiser name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "phone_number": {"name": "phone_number", "description": "Contact mobile number, desensitised data. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `cellphone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "promotion_area": {"name": "promotion_area", "description": "Operation area", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reason": {"name": "reason", "description": "Reason for rejection", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "role": {"name": "role", "description": "Advertiser role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Advertiser status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone": {"name": "telephone", "description": "Fixed phone number, desensitised data IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `telephone_number`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "telephone_number": {"name": "telephone_number", "description": "Fixed phone number, desensitised data This is the newest version of the field `telephone`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "timezone": {"name": "timezone", "description": "Ad account time zone including GMT offset", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"advertiser\"", "created_at": 1723449595.3663583}, "source.tiktok_ads_source.tiktok_ads.campaign_history": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok campaign.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Campaign budget", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_name": {"name": "campaign_name", "description": "Campaign name", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_type": {"name": "campaign_type", "description": "Campaign Type, indicates the campaign is a regular campaign or iOS 14 campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the campaign was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure (for the same campaign, the structure of campaign, adgroups and ads are the same)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "objective_type": {"name": "objective_type", "description": "Advertising objective.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Campaign status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "split_test_variable": {"name": "split_test_variable", "description": "Split Test variables. Optional values; TARGETING, BIDDING_OPTIMIZATION , CREATIVE.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_history\"", "created_at": 1723449595.3665066}, "source.tiktok_ads_source.tiktok_ads.adgroup_history": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad group.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "The Ad group's campaign ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_categories": {"name": "action_categories", "description": "IDs of the action categories (behaviors) that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "action_days": {"name": "action_days", "description": "The number of days of the time period to include action from.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_name": {"name": "adgroup_name", "description": "Ad group name. Character limit is 512 and cannot contain emoji.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age": {"name": "age", "description": "Age groups you want to target. IMPORTANT: This field will not be populated for connectors utilizing the Tiktok Ads v1.3 API version, as the column was renamed. The new column name is `age_group`.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "age_groups": {"name": "age_groups", "description": "Age groups you want to target. This is the newest version of the field `age`, which was renamed after the Tiktok Ads v1.3 API release.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "android_osv": {"name": "android_osv", "description": "Minimum Android version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_download_url": {"name": "app_download_url", "description": "App download link", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_id": {"name": "app_id", "description": "The Application id of the promoted app", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "App name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_type": {"name": "app_type", "description": "App type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience": {"name": "audience", "description": "A list of audience IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "audience_type": {"name": "audience_type", "description": "Audience Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid": {"name": "bid", "description": "CPC, CPM bidding, oCPM learning bidding", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "bid_type": {"name": "bid_type", "description": "Bidding Strategy", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "billing_event": {"name": "billing_event", "description": "Bid method.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget": {"name": "budget", "description": "Ad budget. Returns 0.0 when Campaign Budget Optimization (budget_optimize_switch) is on.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "budget_mode": {"name": "budget_mode", "description": "Budget mode. This field will be ignored when Campaign Budget Optimization (budget_optimize_switch) is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "carriers": {"name": "carriers", "description": "Carriers that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "category": {"name": "category", "description": "Ad group category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "connection_type": {"name": "connection_type", "description": "Device connection types that you want to target. Default; unlimited.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_bid": {"name": "conversion_bid", "description": "oCPM conversion bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpv_video_duration": {"name": "cpv_video_duration", "description": "Video playback duration, required if optimize_goal is VIDEO_VIEW. Allowed values; SIX_SECONDS (video playback 6s), TWO_SECONDS (video playback 2s)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "creative_material_mode": {"name": "creative_material_mode", "description": "Creative delivery mode.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "dayparting": {"name": "dayparting", "description": "Ad delivery period, the default is always and the format is 48 * 7 character string, represented by 0 or 1. > That is, with half an hour as the minimum granularity, a day (24 hours) is divided by the minimum granularity(30 mins) from Monday to Sunday. Resulting in a 48*7 format.0 represents not to be delivered, 1 represents delivery. no transmission, full transmission 0, full transmission 1 all represent full time delivery", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_bid_type": {"name": "deep_bid_type", "description": "Bidding strategy for in-app events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_cpabid": {"name": "deep_cpabid", "description": "Deep bid", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "deep_external_action": {"name": "deep_external_action", "description": "Deep conversion event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "Display name of ad group.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "enable_inventory_filter": {"name": "enable_inventory_filter", "description": "Inventory filtering (Unsafe videos will not be displayed).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "excluded_audience": {"name": "excluded_audience", "description": "A list of audience ID to be excluded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "external_action": {"name": "external_action", "description": "Conversion event for the ad group. It is required when the promoted object is an app with tracking urls, or when pixel_id is specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "fallback_type": {"name": "fallback_type", "description": "Fallback Type. If the audience do not have the app installed, you can have them fall back to install the app, or to view a specific web page. Not applicable for Deferred Deeplink. Allowed values; APP_INSTALL, WEBSITE, UNSET. If website is chosen, you need to specify the url via landing_page_url field.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency": {"name": "frequency", "description": "frequency, together with frequency_schedule, controls how often people see your ad (only available for REACH ads). For example, frequency = 2 frequency_schedule = 3 means \"show ads no more than twice every 3 day\".\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "frequency_schedule": {"name": "frequency_schedule", "description": "frequency, together with frequency, controls how often people see your ad (only available for REACH ads).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "gender": {"name": "gender", "description": "Gender that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "interest_category_v2": {"name": "interest_category_v2", "description": "Interest classification. If the interest is specified, users that do not meet interest target will be excluded during delivery.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ios_osv": {"name": "ios_osv", "description": "Minimum iOS version.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_comment_disable": {"name": "is_comment_disable", "description": "Whether to allow comments on your ads on TikTok, Vigo, Helo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_hfss": {"name": "is_hfss", "description": "Whether the promoted content is HFSS foods (foods that are high in fat, salt, or sugar).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "keywords": {"name": "keywords", "description": "Keywords used.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "languages": {"name": "languages", "description": "Codes of the languages that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "location": {"name": "location", "description": "IDs of the locations that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url_type": {"name": "open_url_type", "description": "The open URL type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "operation_system": {"name": "operation_system", "description": "Device operating systems that you want to target.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "optimize_goal": {"name": "optimize_goal", "description": "Optimization goal.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pacing": {"name": "pacing", "description": "You can choose between PACING_MODE_SMOOTH and PACING_MODE_FAST. For PACING_MODE_SMOOTH, the budget is allocated evenly within the scheduled time. PACING_MODE_FAST would consume budget and produce results as soon as possible. \n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "package": {"name": "package", "description": "Package name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pangle_block_app_list_id": {"name": "pangle_block_app_list_id", "description": "Pangle app block list ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "pixel_id": {"name": "pixel_id", "description": "Pixel ID. Only application for landing pages.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement": {"name": "placement", "description": "The apps where you want to deliver your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "placement_type": {"name": "placement_type", "description": "Placement type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_end_time": {"name": "schedule_end_time", "description": "Ad delivery end time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_start_time": {"name": "schedule_start_time", "description": "Ad delivery start time (UTC+0). Format should be YYYY-MM-DD HH:MM:SS", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "schedule_type": {"name": "schedule_type", "description": "The schedule type, which can be either SCHEDULE_START_END or SCHEDULE_FROM_NOW.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "skip_learning_phase": {"name": "skip_learning_phase", "description": "Whether to skip the learning stage.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "statistic_type": {"name": "statistic_type", "description": "conversion bid statistic type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad group status", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_actions": {"name": "video_actions", "description": "Number of video actions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_download": {"name": "video_download", "description": "Whether users can download your video ads on TikTok(cannot be updated once created).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_history\"", "created_at": 1723449595.3667078}, "source.tiktok_ads_source.tiktok_ads.ad_history": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_history", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_history", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_history"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_history", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents a version of a TikTok ad.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "updated_at": {"name": "updated_at", "description": "Time the record was updated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "adgroup_id": {"name": "adgroup_id", "description": "Ad group ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "advertiser_id": {"name": "advertiser_id", "description": "Advertiser ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "campaign_id": {"name": "campaign_id", "description": "Campaign ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_name": {"name": "ad_name", "description": "Ad Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ad_text": {"name": "ad_text", "description": "The ad text.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "app_name": {"name": "app_name", "description": "The display name of app download ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "call_to_action": {"name": "call_to_action", "description": "Call to action values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "click_tracking_url": {"name": "click_tracking_url", "description": "Click monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "create_time": {"name": "create_time", "description": "Time at which the ad was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "display_name": {"name": "display_name", "description": "The display name of landing page or pure exposure ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "image_ids": {"name": "image_ids", "description": "A list of image IDs.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impression_tracking_url": {"name": "impression_tracking_url", "description": "Display monitoring URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_aco": {"name": "is_aco", "description": "Whether the ad is an automated ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_creative_authorized": {"name": "is_creative_authorized", "description": "Whether you grant displaying some of your ads in our TikTok For Business Creative Center. Only valid for non-US advertisers, the default value is false.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "is_new_structure": {"name": "is_new_structure", "description": "Whether the campaign is a new structure.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "landing_page_url": {"name": "landing_page_url", "description": "Landing page URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "open_url": {"name": "open_url", "description": "The specific location where you want your audience to go if they have your app installed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "opt_status": {"name": "opt_status", "description": "Operation status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "playable_url": {"name": "playable_url", "description": "Playable material url.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_image": {"name": "profile_image", "description": "Avatar URL.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "status": {"name": "status", "description": "Ad status.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_id": {"name": "video_id", "description": "The video ID.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_history\"", "created_at": 1723449595.3668473}, "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "ad_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.ad_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "ad_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "ad_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad for each hour.", "columns": {"ad_id": {"name": "ad_id", "description": "Ad id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"ad_report_hourly\"", "created_at": 1723449595.3671622}, "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "campaign_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "campaign_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "campaign_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each campaign for each hour.", "columns": {"campaign_id": {"name": "campaign_id", "description": "Campaign id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"campaign_report_hourly\"", "created_at": 1723449595.3673224}, "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": {"database": "dbt", "schema": "tiktok_ads", "name": "adgroup_report_hourly", "resource_type": "source", "package_name": "tiktok_ads_source", "path": "models/src_tiktok_ads.yml", "original_file_path": "models/src_tiktok_ads.yml", "unique_id": "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly", "fqn": ["tiktok_ads_source", "tiktok_ads", "adgroup_report_hourly"], "source_name": "tiktok_ads", "source_description": "", "loader": "fivetran", "identifier": "adgroup_report_hourly", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 48, "period": "hour"}, "error_after": {"count": 168, "period": "hour"}, "filter": null}, "external": null, "description": "Each record represents data for each ad group for each hour.", "columns": {"adgroup_id": {"name": "adgroup_id", "description": "Ad group id", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "stat_time_hour": {"name": "stat_time_hour", "description": "Hour of activity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_conversion": {"name": "cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion": {"name": "real_time_conversion", "description": "The number of times your ad achieved an outcome, based on the objective and settings you selected. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpc": {"name": "cpc", "description": "The average amount of money you've spent on a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_play_actions": {"name": "video_play_actions", "description": "The number of times your video starts to play. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion_rate": {"name": "conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is calculated based on the time each ad impression occurred.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_75": {"name": "video_views_p_75", "description": "The number of times your video was played at 75% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result": {"name": "result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the results. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_50": {"name": "video_views_p_50", "description": "The number of times your video was played at 50% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "impressions": {"name": "impressions", "description": "The number of times your ads were on screen.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "comments": {"name": "comments", "description": "The number of comments your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_result": {"name": "real_time_cost_per_result", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now, please go to the ad group section to view the cost per Result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "conversion": {"name": "conversion", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result": {"name": "real_time_result", "description": "The number of times your ad achieved an outcome, based on the optimization goal you selected. As a campaign may have different optimization goals, the total number of result is not supported in campaign section now , Please go to the ad group section to view the result. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_view_p_100": {"name": "video_view_p_100", "description": "The number of times your video was played at 100% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "shares": {"name": "shares", "description": "The number of shares your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_conversion_rate": {"name": "real_time_conversion_rate", "description": "The percentage of results you received out of all the clicks of your ads. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_secondary_goal_result": {"name": "cost_per_secondary_goal_result", "description": "The average cost for each secondary goal result from your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result_rate": {"name": "secondary_goal_result_rate", "description": "The percentage of secondary goal results you achieved out of all of the installs of your adverts. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. The total count is calculated based on the time each ad impression occurred.\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "clicks": {"name": "clicks", "description": "The number of clicks on your ads.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_1000_reached": {"name": "cost_per_1000_reached", "description": "The average cost to reach 1,000 unique users. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_views_p_25": {"name": "video_views_p_25", "description": "The number of times your video was played at 25% of its length. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "reach": {"name": "reach", "description": "The number of unique users who saw your ads at least once. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_cost_per_conversion": {"name": "real_time_cost_per_conversion", "description": "The average amount of money you've spent on a conversion. (The total count is based on when the conversion actually happened.)", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits_rate": {"name": "profile_visits_rate", "description": "The rate of profile visits per impression the paid ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play": {"name": "average_video_play", "description": "The average time your video was played per single video view, including any time spent replaying the video.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "profile_visits": {"name": "profile_visits", "description": "The number of profile visits the ad drove during the campaign. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cpm": {"name": "cpm", "description": "The average amount of money you've spent per 1,000 impressions.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "ctr": {"name": "ctr", "description": "The percentage of times people saw your ad and performed a click.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_2_s": {"name": "video_watched_2_s", "description": "The number of times your video played for at least 2 seconds. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "follows": {"name": "follows", "description": "The number of new followers that were gained within 1 day of a user seeing a paid ad. This metric is only for Boosted TikToks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "result_rate": {"name": "result_rate", "description": "The percentage of results you achieved out of all of the views/clicks on your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the result rate. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "video_watched_6_s": {"name": "video_watched_6_s", "description": "The number of times your video played for at least 6 seconds, or completely played. Replays will not be counted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "secondary_goal_result": {"name": "secondary_goal_result", "description": "The number of times your ad achieved an outcome, based on the secondary goal you selected. As one campaign may have a number of different secondary goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "cost_per_result": {"name": "cost_per_result", "description": "The average cost for each result from your ads. As one campaign may have a number of different optimization goals, this statistic is not supported for campaigns. Please go to ad groups or ads to view the cost per result. (The total count is calculated based on the time each ad impression occurred.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "average_video_play_per_user": {"name": "average_video_play_per_user", "description": "The average time your video was played per person, including any time spent replaying the video. This metric is estimated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "real_time_result_rate": {"name": "real_time_result_rate", "description": "As a campaign may have different optimization goals, the total number of result is not supported in campaign section now ,Please go to the ad group section to view the Result Rate. (The total count is based on when the conversion actually happened.)\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "spend": {"name": "spend", "description": "The estimated total amount of money you've spent on your campaign, ad group or ad during its schedule.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "likes": {"name": "likes", "description": "The number of likes your video creative received within 1 day of a user seeing a paid ad.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "Timestamp of when Fivetran synced a record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "tags": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {"enabled": true}, "relation_name": "\"dbt\".\"tiktok_ads\".\"adgroup_report_hourly\"", "created_at": 1723449595.3674653}, "source.dbt_bouncer_test_project.dummy_source.customers": {"database": "dbt", "schema": "dummy_source", "name": "customers", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/crm/_crm__sources.yml", "original_file_path": "models/staging/crm/_crm__sources.yml", "unique_id": "source.dbt_bouncer_test_project.dummy_source.customers", "fqn": ["dbt_bouncer_test_project", "staging", "crm", "dummy_source", "customers"], "source_name": "dummy_source", "source_description": "", "loader": "python_script", "identifier": "customers", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is actually a seed but we are abusing it so we have a realistic source we can use for development.", "columns": {}, "meta": {"contact": {"email": "chris@email.com", "slack": "@chrissy"}, "owner": "Chris"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true, "external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "patch_path": null, "unrendered_config": {"external_location": "read_csv('./dbt_project/seeds/raw_customers.csv')", "formatter": "oldstyle"}, "relation_name": "read_csv('./dbt_project/seeds/raw_customers.csv')", "created_at": 1723450347.8571322}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_1", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_1"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_1", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the first source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "anna@email.com", "name": {"first": "Anna", "last": "Anderson"}, "slack": "@anna"}, "maturity": "high", "owner": "Anna"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_1\"", "created_at": 1723450347.8579187}, "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": {"database": "dbt", "schema": "sources_that_dont_really_exist", "name": "source_2", "resource_type": "source", "package_name": "dbt_bouncer_test_project", "path": "models/staging/payments/_payments__sources.yml", "original_file_path": "models/staging/payments/_payments__sources.yml", "unique_id": "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2", "fqn": ["dbt_bouncer_test_project", "staging", "payments", "sources_that_dont_really_exist", "source_2"], "source_name": "sources_that_dont_really_exist", "source_description": "", "loader": "python_script", "identifier": "source_2", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "doesnt_exist", "freshness": {"warn_after": {"count": 12, "period": "hour"}, "error_after": {"count": 24, "period": "hour"}, "filter": null}, "external": null, "description": "This is the second source that doesn't exist.", "columns": {}, "meta": {"contact": {"email": "annabelle@email.com", "slack": "@therealanna"}, "owner": "Annabelle"}, "source_meta": {}, "tags": ["example_tag"], "config": {"enabled": true}, "patch_path": null, "unrendered_config": {}, "relation_name": "\"dbt\".\"sources_that_dont_really_exist\".\"source_2\"", "created_at": 1723450347.8580358}}, "macros": {"macro.dbt_duckdb.duckdb__get_catalog": {"name": "duckdb__get_catalog", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_catalog", "macro_sql": "{% macro duckdb__get_catalog(information_schema, schemas) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n with relations AS (\n select\n t.table_name\n , t.database_name\n , t.schema_name\n , 'BASE TABLE' as table_type\n , {{ adapter.catalog_comment('t') }} as table_comment\n from duckdb_tables() t\n WHERE t.database_name = '{{ database }}'\n UNION ALL\n SELECT v.view_name as table_name\n , v.database_name\n , v.schema_name\n , 'VIEW' as table_type\n , {{ adapter.catalog_comment('v') }} as table_comment\n from duckdb_views() v\n WHERE v.database_name = '{{ database }}'\n )\n select\n '{{ database }}' as table_database,\n r.schema_name as table_schema,\n r.table_name,\n r.table_type,\n r.table_comment,\n c.column_name,\n c.column_index as column_index,\n c.data_type as column_type,\n {{ adapter.catalog_comment('c') }} as column_comment,\n '' as table_owner\n FROM relations r JOIN duckdb_columns() c ON r.schema_name = c.schema_name AND r.table_name = c.table_name\n WHERE (\n {%- for schema in schemas -%}\n upper(r.schema_name) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n ORDER BY\n r.schema_name,\n r.table_name,\n c.column_index\n {%- endcall -%}\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4463005, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_binding_char": {"name": "duckdb__get_binding_char", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_binding_char", "macro_sql": "{% macro duckdb__get_binding_char() %}\n {{ return(adapter.get_binding_char()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4475856, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_batch_size": {"name": "duckdb__get_batch_size", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_batch_size", "macro_sql": "{% macro duckdb__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4477088, "supported_languages": null}, "macro.dbt_duckdb.duckdb__load_csv_rows": {"name": "duckdb__load_csv_rows", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/seed.sql", "original_file_path": "macros/seed.sql", "unique_id": "macro.dbt_duckdb.duckdb__load_csv_rows", "macro_sql": "{% macro duckdb__load_csv_rows(model, agate_table) %}\n {% if config.get('fast', true) %}\n {% set seed_file_path = adapter.get_seed_file_path(model) %}\n {% set delimiter = config.get('delimiter', ',') %}\n {% set sql %}\n COPY {{ this.render() }} FROM '{{ seed_file_path }}' (FORMAT CSV, HEADER TRUE, DELIMITER '{{ delimiter }}')\n {% endset %}\n {% do adapter.add_query(sql, abridge_sql_log=True) %}\n {{ return(sql) }}\n {% endif %}\n\n {% set batch_size = get_batch_size() %}\n {% set agate_table = adapter.convert_datetimes_to_strs(agate_table) %}\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4495382, "supported_languages": null}, "macro.dbt_duckdb.duckdb_escape_comment": {"name": "duckdb_escape_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb_escape_comment", "macro_sql": "{% macro duckdb_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.450551, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_comment": {"name": "duckdb__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_comment", "macro_sql": "{% macro duckdb__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4507952, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_column_comment": {"name": "duckdb__alter_column_comment", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/persist_docs.sql", "original_file_path": "macros/persist_docs.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_column_comment", "macro_sql": "{% macro duckdb__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = duckdb_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4514182, "supported_languages": null}, "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns": {"name": "duckdb__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/columns.sql", "original_file_path": "macros/columns.sql", "unique_id": "macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns", "macro_sql": "{% macro duckdb__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns %}\n {% for column in add_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} add column\n {{ column.name }} {{ column.data_type }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n {% if remove_columns %}\n {% for column in remove_columns %}\n {% set sql -%}\n alter {{ relation.type }} {{ relation }} drop column\n {{ column.name }}\n {%- endset -%}\n {% do run_query(sql) %}\n {% endfor %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4523528, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql": {"name": "duckdb__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/incremental_helper.sql", "original_file_path": "macros/incremental_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql", "macro_sql": "{% macro duckdb__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }} as DBT_INCREMENTAL_TARGET\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = DBT_INCREMENTAL_TARGET.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4541702, "supported_languages": null}, "macro.dbt_duckdb.duckdb__datediff": {"name": "duckdb__datediff", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_duckdb.duckdb__datediff", "macro_sql": "{% macro duckdb__datediff(first_date, second_date, datepart) -%}\n date_diff('{{ datepart }}', {{ first_date }}::timestamp, {{ second_date}}::timestamp )\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4558153, "supported_languages": null}, "macro.dbt_duckdb.duckdb__dateadd": {"name": "duckdb__dateadd", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_duckdb.duckdb__dateadd", "macro_sql": "{% macro duckdb__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n date_add({{ from_date_or_timestamp }}, interval ({{ interval }}) {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4560313, "supported_languages": null}, "macro.dbt_duckdb.duckdb__last_day": {"name": "duckdb__last_day", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/lastday.sql", "original_file_path": "macros/utils/lastday.sql", "unique_id": "macro.dbt_duckdb.duckdb__last_day", "macro_sql": "{% macro duckdb__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- duckdb dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4565253, "supported_languages": null}, "macro.dbt_duckdb.register_upstream_external_models": {"name": "register_upstream_external_models", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/upstream.sql", "original_file_path": "macros/utils/upstream.sql", "unique_id": "macro.dbt_duckdb.register_upstream_external_models", "macro_sql": "{%- macro register_upstream_external_models() -%}\n{% if execute %}\n{% set upstream_nodes = {} %}\n{% set upstream_schemas = {} %}\n{% for node in selected_resources %}\n {% for upstream_node in graph['nodes'][node]['depends_on']['nodes'] %}\n {% if upstream_node not in upstream_nodes and upstream_node not in selected_resources %}\n {% do upstream_nodes.update({upstream_node: None}) %}\n {% set upstream = graph['nodes'].get(upstream_node) %}\n {% if upstream\n and upstream.resource_type in ('model', 'seed')\n and upstream.config.materialized=='external'\n %}\n {%- set upstream_rel = api.Relation.create(\n database=upstream['database'],\n schema=upstream['schema'],\n identifier=upstream['alias']\n ) -%}\n {%- set location = upstream.config.get('location', external_location(upstream_rel, upstream.config)) -%}\n {%- set rendered_options = render_write_options(upstream.config) -%}\n {%- set upstream_location = adapter.external_read_location(location, rendered_options) -%}\n {% if upstream_rel.schema not in upstream_schemas %}\n {% call statement('main', language='sql') -%}\n create schema if not exists {{ upstream_rel.schema }}\n {%- endcall %}\n {% do upstream_schemas.update({upstream_rel.schema: None}) %}\n {% endif %}\n {% call statement('main', language='sql') -%}\n create or replace view {{ upstream_rel }} as (\n select * from '{{ upstream_location }}'\n );\n {%- endcall %}\n {%- endif %}\n {% endif %}\n {% endfor %}\n{% endfor %}\n{% do adapter.commit() %}\n{% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.45893, "supported_languages": null}, "macro.dbt_duckdb.external_location": {"name": "external_location", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/external_location.sql", "original_file_path": "macros/utils/external_location.sql", "unique_id": "macro.dbt_duckdb.external_location", "macro_sql": "{%- macro external_location(relation, config) -%}\n {%- if config.get('options', {}).get('partition_by') is none -%}\n {%- set format = config.get('format', 'parquet') -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}.{{ format }}\n {%- else -%}\n {{- adapter.external_root() }}/{{ relation.identifier }}\n {%- endif -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4594824, "supported_languages": null}, "macro.dbt_duckdb.duckdb__listagg": {"name": "duckdb__listagg", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_duckdb.duckdb__listagg", "macro_sql": "{% macro duckdb__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n {% if limit_num -%}\n list_aggr(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n 'string_agg',\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4600596, "supported_languages": null}, "macro.dbt_duckdb.duckdb__any_value": {"name": "duckdb__any_value", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_duckdb.duckdb__any_value", "macro_sql": "{% macro duckdb__any_value(expression) -%}\n\n arbitrary({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4601974, "supported_languages": null}, "macro.dbt_duckdb.duckdb__split_part": {"name": "duckdb__split_part", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/utils/splitpart.sql", "original_file_path": "macros/utils/splitpart.sql", "unique_id": "macro.dbt_duckdb.duckdb__split_part", "macro_sql": "{% macro duckdb__split_part(string_text, delimiter_text, part_number) %}\n string_split({{ string_text }}, {{ delimiter_text }})[ {{ part_number }} ]\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4604046, "supported_languages": null}, "macro.dbt_duckdb.materialization_incremental_duckdb": {"name": "materialization_incremental_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/incremental.sql", "original_file_path": "macros/materializations/incremental.sql", "unique_id": "macro.dbt_duckdb.materialization_incremental_duckdb", "macro_sql": "{% materialization incremental, adapter=\"duckdb\", supported_languages=['sql', 'python'] -%}\n\n {%- set language = model['language'] -%}\n -- only create temp tables if using local duckdb, as it is not currently supported for remote databases\n {%- set temporary = not adapter.is_motherduck() -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, compiled_code, language) %}\n {% elif full_refresh_mode %}\n {% set build_sql = create_table_as(False, intermediate_relation, compiled_code, language) %}\n {% set need_swap = true %}\n {% else %}\n {% if not temporary %}\n -- if not using a temporary table we will update the temp relation to use a different temp schema (\"dbt_temp\" by default)\n {% set temp_relation = temp_relation.incorporate(path=adapter.get_temp_relation_path(this)) %}\n {% do run_query(create_schema(temp_relation)) %}\n -- then drop the temp relation after we insert the incremental data into the target relation\n {% do to_drop.append(temp_relation) %}\n {% endif %}\n {% if language == 'python' %}\n {% set build_python = create_table_as(False, temp_relation, compiled_code, language) %}\n {% call statement(\"pre\", language=language) %}\n {{- build_python }}\n {% endcall %}\n {% else %} {# SQL #}\n {% do run_query(create_table_as(temporary, temp_relation, compiled_code, language)) %}\n {% endif %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n {% set language = \"sql\" %}\n\n {% endif %}\n\n {% call statement(\"main\", language=language) %}\n {{- build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.create_table_as", "macro.dbt.run_query", "macro.dbt.create_schema", "macro.dbt.statement", "macro.dbt.process_schema_changes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4665885, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_external_duckdb": {"name": "materialization_external_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/external.sql", "original_file_path": "macros/materializations/external.sql", "unique_id": "macro.dbt_duckdb.materialization_external_duckdb", "macro_sql": "{% materialization external, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set location = render(config.get('location', default=external_location(this, config))) -%})\n {%- set rendered_options = render_write_options(config) -%}\n {%- set format = config.get('format', 'parquet') -%}\n {%- set write_options = adapter.external_write_options(location, rendered_options) -%}\n {%- set read_location = adapter.external_read_location(location, rendered_options) -%}\n\n -- set language - python or sql\n {%- set language = model['language'] -%}\n\n {%- set target_relation = this.incorporate(type='view') %}\n\n -- Continue as normal materialization\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set temp_relation = make_intermediate_relation(this.incorporate(type='table'), suffix='__dbt_tmp') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation, suffix='__dbt_int') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_temp_relation = load_cached_relation(temp_relation) -%}\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_temp_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('create_table', language=language) -%}\n {{- create_table_as(False, temp_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- write an temp relation into file\n {{ write_to_file(temp_relation, location, write_options) }}\n -- create a view on top of the location\n {% call statement('main', language='sql') -%}\n create or replace view {{ intermediate_relation }} as (\n select * from '{{ read_location }}'\n );\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(temp_relation) }}\n\n -- register table into glue\n {%- set plugin_name = config.get('plugin') -%}\n {%- set glue_register = config.get('glue_register', default=false) -%}\n {%- set partition_columns = config.get('partition_columns', []) -%}\n {% if plugin_name is not none or glue_register is true %}\n {% if glue_register %}\n {# legacy hack to set the glue database name, deprecate this #}\n {%- set plugin_name = 'glue|' ~ config.get('glue_database', 'default') -%}\n {% endif %}\n {% do store_relation(plugin_name, target_relation, location, format, config) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt_duckdb.external_location", "macro.dbt_duckdb.render_write_options", "macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt_duckdb.write_to_file", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt_duckdb.store_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4715922, "supported_languages": ["sql", "python"]}, "macro.dbt_duckdb.materialization_table_duckdb": {"name": "materialization_table_duckdb", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/materializations/table.sql", "original_file_path": "macros/materializations/table.sql", "unique_id": "macro.dbt_duckdb.materialization_table_duckdb", "macro_sql": "{% materialization table, adapter=\"duckdb\", supported_languages=['sql', 'python'] %}\n\n {%- set language = model['language'] -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main', language=language) -%}\n {{- create_table_as(False, intermediate_relation, compiled_code, language) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.create_table_as", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4742012, "supported_languages": ["sql", "python"]}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4774044, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4779708, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4791145, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4793231, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4794405, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4797654, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4799383, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.480478, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4806614, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.480934, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4811747, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4812834, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.481596, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4817681, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482042, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482184, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4825318, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4827125, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.482977, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.483105, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4833808, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4835274, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4837747, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4839857, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.484818, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.484973, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4851348, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4852846, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4854434, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4855928, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4857616, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4859447, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4861133, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4862707, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4864364, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4865813, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4867427, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.486893, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.487256, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4875052, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4878707, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4881897, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4884422, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.488558, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4888704, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4890184, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4893143, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4894626, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.489806, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490186, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490353, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.490965, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4914193, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4917514, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4919336, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.492197, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.492317, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4925513, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4926374, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.49289, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4929807, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.493264, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4934158, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4937224, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4938846, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4941366, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4942484, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4944944, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4946845, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.495411, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4958687, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.496071, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4967382, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4975493, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4983308, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4985883, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4990795, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4994674, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.4996588, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.500216, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5005383, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5008986, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5013785, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5018115, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.50223, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.502523, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.502918, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5032756, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.50365, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5049028, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5051563, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5053356, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5055187, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.505694, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5330665, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5372179, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5382974, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5385256, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5390217, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5391989, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5393286, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5394633, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5395758, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5397258, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5398443, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5402925, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.540462, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.541727, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5443456, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5483952, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5487695, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5490835, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5505536, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5507824, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5514057, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5540962, "supported_languages": ["sql"]}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5548146, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5597177, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5675492, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5687304, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5700972, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5709288, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5722752, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5728443, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.573543, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.573784, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.574532, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5794518, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5810852, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5813508, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5824816, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5827463, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5834088, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5868173, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5870593, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5871775, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5874553, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5876257, "supported_languages": null}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5879672, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5883443, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.589277, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5895977, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.589827, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5904853, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5922272, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.59482, "supported_languages": ["sql"]}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5954444, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.595617, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5958173, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5959847, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5962534, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5967326, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5986784, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5988395, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5991473, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5993648, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.5995746, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.599757, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6009407, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6012993, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6014853, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6018329, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6020563, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.602709, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.602955, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6037521, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.604118, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6043088, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6044712, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6046567, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.606413, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6065803, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6067967, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60709, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60733, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.607651, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.607831, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.608016, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6082563, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6088028, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6090267, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.609168, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6095634, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6097574, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ compiled_code }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.60996, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6127648, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6130505, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6132553, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6135445, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.613754, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6139503, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.614152, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6144326, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6146562, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6149867, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6151886, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6153502, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.615814, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.615988, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.616158, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6163127, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6165178, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6166914, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6196828, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6198034, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6199682, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6200829, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6204288, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.62061, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6207342, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.620958, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6211677, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6213892, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6216059, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6218414, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6226187, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6228004, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6230497, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.62327, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6244094, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6255033, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6257339, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6264598, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6265984, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.626765, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6271667, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.627351, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6274915, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.627651, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6277816, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6293473, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.630598, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6314242, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6316533, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6330643, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.633645, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.63394, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6342406, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6345625, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6351027, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6353357, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.635646, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6358578, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6361144, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6363306, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6370363, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6382391, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6385763, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6388426, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6392782, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.639727, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.640039, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6402524, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6408947, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6412976, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6414795, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6416814, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6418767, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6425216, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6430593, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6432755, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.643588, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6439612, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6442156, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6451497, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6452813, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6458929, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6460726, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6462092, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6475778, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6479623, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.648293, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6485872, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6487212, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.648985, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6491337, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.649391, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6495352, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6497664, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.64989, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.650146, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6502936, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6508446, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6510336, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6513216, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.651473, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6517348, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6519666, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6527352, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6529198, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.653349, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6540658, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.654555, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.654737, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.get_column_names", "macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6549127, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6551495, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6552737, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6555343, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.655682, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6564372, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.656588, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6577268, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6579428, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6582046, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6586063, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6587663, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6589444, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6593766, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6596138, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6597402, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6599977, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6601493, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6615598, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6618226, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.662677, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6630836, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\nconfig_dict = {{ config_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6636686, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6641374, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.664219, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.664764, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6650388, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6653695, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6656623, "supported_languages": null}, "macro.spark_utils.get_tables": {"name": "get_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_tables", "macro_sql": "{% macro get_tables(table_regex_pattern='.*') %}\n\n {% set tables = [] %}\n {% for database in spark__list_schemas('not_used') %}\n {% for table in spark__list_relations_without_caching(database[0]) %}\n {% set db_tablename = database[0] ~ \".\" ~ table[1] %}\n {% set is_match = modules.re.match(table_regex_pattern, db_tablename) %}\n {% if is_match %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('type', 'TYPE', 'Type'))|first %}\n {% if table_type[1]|lower != 'view' %}\n {{ tables.append(db_tablename) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% endfor %}\n {{ return(tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.670198, "supported_languages": null}, "macro.spark_utils.get_delta_tables": {"name": "get_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_delta_tables", "macro_sql": "{% macro get_delta_tables(table_regex_pattern='.*') %}\n\n {% set delta_tables = [] %}\n {% for db_tablename in get_tables(table_regex_pattern) %}\n {% call statement('table_detail', fetch_result=True) -%}\n describe extended {{ db_tablename }}\n {% endcall %}\n\n {% set table_type = load_result('table_detail').table|reverse|selectattr(0, 'in', ('provider', 'PROVIDER', 'Provider'))|first %}\n {% if table_type[1]|lower == 'delta' %}\n {{ delta_tables.append(db_tablename) }}\n {% endif %}\n {% endfor %}\n {{ return(delta_tables) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.670988, "supported_languages": null}, "macro.spark_utils.get_statistic_columns": {"name": "get_statistic_columns", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.get_statistic_columns", "macro_sql": "{% macro get_statistic_columns(table) %}\n\n {% call statement('input_columns', fetch_result=True) %}\n SHOW COLUMNS IN {{ table }}\n {% endcall %}\n {% set input_columns = load_result('input_columns').table %}\n\n {% set output_columns = [] %}\n {% for column in input_columns %}\n {% call statement('column_information', fetch_result=True) %}\n DESCRIBE TABLE {{ table }} `{{ column[0] }}`\n {% endcall %}\n {% if not load_result('column_information').table[1][1].startswith('struct') and not load_result('column_information').table[1][1].startswith('array') %}\n {{ output_columns.append('`' ~ column[0] ~ '`') }}\n {% endif %}\n {% endfor %}\n {{ return(output_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6718872, "supported_languages": null}, "macro.spark_utils.spark_optimize_delta_tables": {"name": "spark_optimize_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_optimize_delta_tables", "macro_sql": "{% macro spark_optimize_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Optimizing \" ~ table) }}\n {% do run_query(\"optimize \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6726189, "supported_languages": null}, "macro.spark_utils.spark_vacuum_delta_tables": {"name": "spark_vacuum_delta_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_vacuum_delta_tables", "macro_sql": "{% macro spark_vacuum_delta_tables(table_regex_pattern='.*') %}\n\n {% for table in get_delta_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Vacuuming \" ~ table) }}\n {% do run_query(\"vacuum \" ~ table) %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_delta_tables", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6733458, "supported_languages": null}, "macro.spark_utils.spark_analyze_tables": {"name": "spark_analyze_tables", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/maintenance_operation.sql", "original_file_path": "macros/maintenance_operation.sql", "unique_id": "macro.spark_utils.spark_analyze_tables", "macro_sql": "{% macro spark_analyze_tables(table_regex_pattern='.*') %}\n\n {% for table in get_tables(table_regex_pattern) %}\n {% set start=modules.datetime.datetime.now() %}\n {% set columns = get_statistic_columns(table) | join(',') %}\n {% set message_prefix=loop.index ~ \" of \" ~ loop.length %}\n {{ dbt_utils.log_info(message_prefix ~ \" Analyzing \" ~ table) }}\n {% if columns != '' %}\n {% do run_query(\"analyze table \" ~ table ~ \" compute statistics for columns \" ~ columns) %}\n {% endif %}\n {% set end=modules.datetime.datetime.now() %}\n {% set total_seconds = (end - start).total_seconds() | round(2) %}\n {{ dbt_utils.log_info(message_prefix ~ \" Finished \" ~ table ~ \" in \" ~ total_seconds ~ \"s\") }}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.get_tables", "macro.spark_utils.get_statistic_columns", "macro.dbt_utils.log_info", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6742544, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_pattern": {"name": "spark__get_relations_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_pattern", "macro_sql": "{% macro spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n show table extended in {{ schema_pattern }} like '{{ table_pattern }}'\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=None,\n schema=row[0],\n identifier=row[1],\n type=('view' if 'Type: VIEW' in row[3] else 'table')\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6757834, "supported_languages": null}, "macro.spark_utils.spark__get_relations_by_prefix": {"name": "spark__get_relations_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_relations_by_prefix", "macro_sql": "{% macro spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {% set table_pattern = table_pattern ~ '*' %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6761248, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_pattern": {"name": "spark__get_tables_by_pattern", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_pattern", "macro_sql": "{% macro spark__get_tables_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.676401, "supported_languages": null}, "macro.spark_utils.spark__get_tables_by_prefix": {"name": "spark__get_tables_by_prefix", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "original_file_path": "macros/dbt_utils/sql/get_relations_by_prefix.sql", "unique_id": "macro.spark_utils.spark__get_tables_by_prefix", "macro_sql": "{% macro spark__get_tables_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(spark_utils.spark__get_relations_by_prefix(schema_pattern, table_pattern, exclude='', database=target.database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.spark__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6766715, "supported_languages": null}, "macro.spark_utils.spark__split_part": {"name": "spark__split_part", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/split_part.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/split_part.sql", "unique_id": "macro.spark_utils.spark__split_part", "macro_sql": "{% macro spark__split_part(string_text, delimiter_text, part_number) %}\n\n {% set delimiter_expr %}\n \n -- escape if starts with a special character\n case when regexp_extract({{ delimiter_text }}, '([^A-Za-z0-9])(.*)', 1) != '_'\n then concat('\\\\', {{ delimiter_text }})\n else {{ delimiter_text }} end\n \n {% endset %}\n\n {% set split_part_expr %}\n \n split(\n {{ string_text }},\n {{ delimiter_expr }}\n )[({{ part_number - 1 }})]\n \n {% endset %}\n \n {{ return(split_part_expr) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6772294, "supported_languages": null}, "macro.spark_utils.spark__datediff": {"name": "spark__datediff", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datediff.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datediff.sql", "unique_id": "macro.spark_utils.spark__datediff", "macro_sql": "{% macro spark__datediff(first_date, second_date, datepart) %}\n\n {%- if datepart in ['day', 'week', 'month', 'quarter', 'year'] -%}\n \n {# make sure the dates are real, otherwise raise an error asap #}\n {% set first_date = spark_utils.assert_not_null('date', first_date) %}\n {% set second_date = spark_utils.assert_not_null('date', second_date) %}\n \n {%- endif -%}\n \n {%- if datepart == 'day' -%}\n \n datediff({{second_date}}, {{first_date}})\n \n {%- elif datepart == 'week' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(datediff({{second_date}}, {{first_date}})/7)\n else ceil(datediff({{second_date}}, {{first_date}})/7)\n end\n \n -- did we cross a week boundary (Sunday)?\n + case\n when {{first_date}} < {{second_date}} and dayofweek({{second_date}}) < dayofweek({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofweek({{second_date}}) > dayofweek({{first_date}}) then -1\n else 0 end\n\n {%- elif datepart == 'month' -%}\n\n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}})))\n else ceil(months_between(date({{second_date}}), date({{first_date}})))\n end\n \n -- did we cross a month boundary?\n + case\n when {{first_date}} < {{second_date}} and dayofmonth({{second_date}}) < dayofmonth({{first_date}}) then 1\n when {{first_date}} > {{second_date}} and dayofmonth({{second_date}}) > dayofmonth({{first_date}}) then -1\n else 0 end\n \n {%- elif datepart == 'quarter' -%}\n \n case when {{first_date}} < {{second_date}}\n then floor(months_between(date({{second_date}}), date({{first_date}}))/3)\n else ceil(months_between(date({{second_date}}), date({{first_date}}))/3)\n end\n \n -- did we cross a quarter boundary?\n + case\n when {{first_date}} < {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n < (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then 1\n when {{first_date}} > {{second_date}} and (\n (dayofyear({{second_date}}) - (quarter({{second_date}}) * 365/4))\n > (dayofyear({{first_date}}) - (quarter({{first_date}}) * 365/4))\n ) then -1\n else 0 end\n\n {%- elif datepart == 'year' -%}\n \n year({{second_date}}) - year({{first_date}})\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set divisor -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n case when {{first_date}} < {{second_date}}\n then ceil((\n {# make sure the timestamps are real, otherwise raise an error asap #}\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n else floor((\n {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', second_date)) }}\n - {{ spark_utils.assert_not_null('to_unix_timestamp', spark_utils.assert_not_null('to_timestamp', first_date)) }}\n ) / {{divisor}})\n end\n \n {% if datepart == 'millisecond' %}\n + cast(date_format({{second_date}}, 'SSS') as int)\n - cast(date_format({{first_date}}, 'SSS') as int)\n {% endif %}\n \n {% if datepart == 'microsecond' %} \n {% set capture_str = '[0-9]{4}-[0-9]{2}-[0-9]{2}.[0-9]{2}:[0-9]{2}:[0-9]{2}.([0-9]{6})' %}\n -- Spark doesn't really support microseconds, so this is a massive hack!\n -- It will only work if the timestamp-string is of the format\n -- 'yyyy-MM-dd-HH mm.ss.SSSSSS'\n + cast(regexp_extract({{second_date}}, '{{capture_str}}', 1) as int)\n - cast(regexp_extract({{first_date}}, '{{capture_str}}', 1) as int) \n {% endif %}\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro datediff not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6837811, "supported_languages": null}, "macro.spark_utils.spark__dateadd": {"name": "spark__dateadd", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/dateadd.sql", "unique_id": "macro.spark_utils.spark__dateadd", "macro_sql": "{% macro spark__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {%- set clock_component -%}\n {# make sure the dates + timestamps are real, otherwise raise an error asap #}\n to_unix_timestamp({{ spark_utils.assert_not_null('to_timestamp', from_date_or_timestamp) }})\n - to_unix_timestamp({{ spark_utils.assert_not_null('date', from_date_or_timestamp) }})\n {%- endset -%}\n\n {%- if datepart in ['day', 'week'] -%}\n \n {%- set multiplier = 7 if datepart == 'week' else 1 -%}\n\n to_timestamp(\n to_unix_timestamp(\n date_add(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ['month', 'quarter', 'year'] -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'month' -%} 1\n {%- elif datepart == 'quarter' -%} 3\n {%- elif datepart == 'year' -%} 12\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n to_unix_timestamp(\n add_months(\n {{ spark_utils.assert_not_null('date', from_date_or_timestamp) }},\n cast({{interval}} * {{multiplier}} as int)\n )\n ) + {{clock_component}}\n )\n\n {%- elif datepart in ('hour', 'minute', 'second', 'millisecond', 'microsecond') -%}\n \n {%- set multiplier -%} \n {%- if datepart == 'hour' -%} 3600\n {%- elif datepart == 'minute' -%} 60\n {%- elif datepart == 'second' -%} 1\n {%- elif datepart == 'millisecond' -%} (1/1000000)\n {%- elif datepart == 'microsecond' -%} (1/1000000)\n {%- endif -%}\n {%- endset -%}\n\n to_timestamp(\n {{ spark_utils.assert_not_null('to_unix_timestamp', from_date_or_timestamp) }}\n + cast({{interval}} * {{multiplier}} as int)\n )\n\n {%- else -%}\n\n {{ exceptions.raise_compiler_error(\"macro dateadd not implemented for datepart ~ '\" ~ datepart ~ \"' ~ on Spark\") }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.spark_utils.assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6864185, "supported_languages": null}, "macro.spark_utils.spark__concat": {"name": "spark__concat", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/concat.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/concat.sql", "unique_id": "macro.spark_utils.spark__concat", "macro_sql": "{% macro spark__concat(fields) -%}\n concat({{ fields|join(', ') }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.686606, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp": {"name": "spark__current_timestamp", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp", "macro_sql": "{% macro spark__current_timestamp() %}\n current_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6867318, "supported_languages": null}, "macro.spark_utils.spark__current_timestamp_in_utc": {"name": "spark__current_timestamp_in_utc", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/current_timestamp.sql", "unique_id": "macro.spark_utils.spark__current_timestamp_in_utc", "macro_sql": "{% macro spark__current_timestamp_in_utc() %}\n unix_timestamp()\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.686815, "supported_languages": null}, "macro.spark_utils.spark__type_numeric": {"name": "spark__type_numeric", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "original_file_path": "macros/dbt_utils/cross_db_utils/datatypes.sql", "unique_id": "macro.spark_utils.spark__type_numeric", "macro_sql": "{% macro spark__type_numeric() %}\n decimal(28, 6)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6869276, "supported_languages": null}, "macro.spark_utils.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/snowplow/convert_timezone.sql", "original_file_path": "macros/snowplow/convert_timezone.sql", "unique_id": "macro.spark_utils.spark__convert_timezone", "macro_sql": "{% macro spark__convert_timezone(in_tz, out_tz, in_timestamp) %}\n from_utc_timestamp(to_utc_timestamp({{in_timestamp}}, {{in_tz}}), {{out_tz}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6871345, "supported_languages": null}, "macro.spark_utils.assert_not_null": {"name": "assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.assert_not_null", "macro_sql": "{% macro assert_not_null(function, arg) -%}\n {{ return(adapter.dispatch('assert_not_null', 'spark_utils')(function, arg)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.spark_utils.default__assert_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6874397, "supported_languages": null}, "macro.spark_utils.default__assert_not_null": {"name": "default__assert_not_null", "resource_type": "macro", "package_name": "spark_utils", "path": "macros/etc/assert_not_null.sql", "original_file_path": "macros/etc/assert_not_null.sql", "unique_id": "macro.spark_utils.default__assert_not_null", "macro_sql": "{% macro default__assert_not_null(function, arg) %}\n\n coalesce({{function}}({{arg}}), nvl2({{function}}({{arg}}), assert_true({{function}}({{arg}}) is not null), null))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6876416, "supported_languages": null}, "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter": {"name": "tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.tiktok_ads_extract_url_parameter", "macro_sql": "{% macro tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ return(adapter.dispatch('tiktok_ads_extract_url_parameter', 'tiktok_ads_source') (field, url_parameter)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6879823, "supported_languages": null}, "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter": {"name": "default__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.default__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro default__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6881347, "supported_languages": null}, "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter": {"name": "spark__tiktok_ads_extract_url_parameter", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/tiktok_ads_extract_url_parameters.sql", "original_file_path": "macros/tiktok_ads_extract_url_parameters.sql", "unique_id": "macro.tiktok_ads_source.spark__tiktok_ads_extract_url_parameter", "macro_sql": "{% macro spark__tiktok_ads_extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6883404, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_report_hourly_columns": {"name": "get_ad_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_report_hourly_columns.sql", "original_file_path": "macros/get_ad_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_report_hourly_columns", "macro_sql": "{% macro get_ad_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6910837, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_history_columns": {"name": "get_campaign_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_history_columns.sql", "original_file_path": "macros/get_campaign_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_history_columns", "macro_sql": "{% macro get_campaign_history_columns() %}\n\n{% set columns = [\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"campaign_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"split_test_variable\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6919754, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_report_hourly_columns": {"name": "get_ad_group_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_report_hourly_columns.sql", "original_file_path": "macros/get_ad_group_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_report_hourly_columns", "macro_sql": "{% macro get_ad_group_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__ad_group_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.694666, "supported_languages": null}, "macro.tiktok_ads_source.get_advertiser_columns": {"name": "get_advertiser_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_advertiser_columns.sql", "original_file_path": "macros/get_advertiser_columns.sql", "unique_id": "macro.tiktok_ads_source.get_advertiser_columns", "macro_sql": "{% macro get_advertiser_columns() %}\n\n{% set columns = [\n {\"name\": \"address\", \"datatype\": dbt.type_string()},\n {\"name\": \"balance\", \"datatype\": dbt.type_float()},\n {\"name\": \"cellphone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"company\", \"datatype\": dbt.type_string()},\n {\"name\": \"contacter\", \"datatype\": dbt.type_string()},\n {\"name\": \"country\", \"datatype\": dbt.type_string()},\n {\"name\": \"currency\", \"datatype\": dbt.type_string()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"email\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"industry\", \"datatype\": dbt.type_string()},\n {\"name\": \"language\", \"datatype\": dbt.type_string()},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"phone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone\", \"datatype\": dbt.type_string()},\n {\"name\": \"telephone_number\", \"datatype\": dbt.type_string()},\n {\"name\": \"timezone\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6964226, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_group_history_columns": {"name": "get_ad_group_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_group_history_columns.sql", "original_file_path": "macros/get_ad_group_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_group_history_columns", "macro_sql": "{% macro get_ad_group_history_columns() %}\n\n{% set columns = [\n {\"name\": \"action_days\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"adgroup_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"audience_type\", \"datatype\": dbt.type_string()},\n {\"name\": \"budget\", \"datatype\": dbt.type_float()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"category\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"display_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"frequency\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"frequency_schedule\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"gender\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"interest_category_v_2\", \"datatype\": dbt.type_string()},\n {\"name\": \"action_categories\", \"datatype\": dbt.type_string()},\n {\"name\": \"age\", \"datatype\": dbt.type_string()},\n {\"name\": \"age_groups\", \"datatype\": dbt.type_string()},\n {\"name\": \"languages\", \"datatype\": dbt.type_string()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_float", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.6984131, "supported_languages": null}, "macro.tiktok_ads_source.get_campaign_report_hourly_columns": {"name": "get_campaign_report_hourly_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_campaign_report_hourly_columns.sql", "original_file_path": "macros/get_campaign_report_hourly_columns.sql", "unique_id": "macro.tiktok_ads_source.get_campaign_report_hourly_columns", "macro_sql": "{% macro get_campaign_report_hourly_columns() %}\n\n{% set columns = [\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"average_video_play\", \"datatype\": dbt.type_float()},\n {\"name\": \"average_video_play_per_user\", \"datatype\": dbt.type_float()},\n {\"name\": \"clicks\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"comments\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"conversion_rate\", \"datatype\": dbt.type_float()},\n {\"name\": \"cost_per_conversion\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpc\", \"datatype\": dbt.type_float()},\n {\"name\": \"cpm\", \"datatype\": dbt.type_float()},\n {\"name\": \"ctr\", \"datatype\": dbt.type_float()},\n {\"name\": \"follows\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"impressions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"likes\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"profile_visits\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"reach\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"shares\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"spend\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"stat_time_hour\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"video_play_actions\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_25\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_50\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_views_p_75\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_2_s\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"video_watched_6_s\", \"datatype\": dbt.type_numeric()}\n] %}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('tiktok_ads__campaign_hourly_passthrough_metrics')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_float", "macro.dbt.type_timestamp", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.701131, "supported_languages": null}, "macro.tiktok_ads_source.get_ad_history_columns": {"name": "get_ad_history_columns", "resource_type": "macro", "package_name": "tiktok_ads_source", "path": "macros/get_ad_history_columns.sql", "original_file_path": "macros/get_ad_history_columns.sql", "unique_id": "macro.tiktok_ads_source.get_ad_history_columns", "macro_sql": "{% macro get_ad_history_columns() %}\n\n{% set columns = [\n {\"name\": \"ad_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"ad_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"adgroup_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"advertiser_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"call_to_action\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"click_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"impression_tracking_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"landing_page_url\", \"datatype\": dbt.type_string()},\n {\"name\": \"updated_at\", \"datatype\": dbt.type_timestamp()}\n\n] %}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7022405, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7026224, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.705576, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7104392, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7127445, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.712857, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7129629, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) -%}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n\n{%- for column in staging_columns %}\n {% if column.name|lower in source_column_names -%}\n {{ fivetran_utils.quote_column(column) }} as \n {%- if 'alias' in column %} {{ column.alias }} {% else %} {{ fivetran_utils.quote_column(column) }} {%- endif -%}\n {%- else -%}\n cast(null as {{ column.datatype }})\n {%- if 'alias' in column %} as {{ column.alias }} {% else %} as {{ fivetran_utils.quote_column(column) }} {% endif -%}\n {%- endif -%}\n {%- if not loop.last -%} , {% endif -%}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7144463, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {% if 'quote' in column %}\n {% if column.quote %}\n {% if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {% elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {% else %}\n \"{{ column.name }}\"\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n {% else %}\n {{ column.name }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7150095, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.715401, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.715781, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7163353, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7167897, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7173762, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.718753, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7190661, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7191782, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7192879, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7193968, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7218153, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.721989, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7221563, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7223186, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.724134, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.725256, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7259011, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.726075, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7262425, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7264113, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.726579, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7267604, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.730571, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7309403, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7317255, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7322392, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732405, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7325666, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732747, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.732911, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7330701, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7342584, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.734524, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7347848, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7350452, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7352962, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.735578, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7358563, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7361042, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7364633, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7375789, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7378466, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7386963, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7393372, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7401664, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7403426, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.740515, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7406867, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7408555, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7410293, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7414942, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7416813, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7418604, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7420402, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7422323, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7430308, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7441275, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.744512, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.744759, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7454956, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7461123, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.74697, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7471237, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.747415, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7477202, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7478588, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7479959, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7482169, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7483487, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7485979, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7487004, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7488046, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.749265, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.749477, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7497013, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7500849, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7502055, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7503257, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7504346, "supported_languages": null}, "macro.fivetran_utils.postgres__wrap_in_quotes": {"name": "postgres__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.postgres__wrap_in_quotes", "macro_sql": "{%- macro postgres__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.750543, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7508805, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7510319, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.751233, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7515569, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7520452, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7523699, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.752734, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.753227, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7540073, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7571056, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7573533, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.757739, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7583256, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7589285, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7598007, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7600968, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7602293, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.760511, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.760843, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.761794, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7633598, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7637403, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7641284, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.76673, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.770514, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7729647, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.773444, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7736561, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7740467, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7745993, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.774974, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7752495, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.default__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7757077, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7758496, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7759902, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.776131, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7769108, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7771366, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7773051, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7774994, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7776692, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7778404, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7780154, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7790716, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet \r\nor all columns were excluded. This star is only output during \r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }} {%- if prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }} {%- if prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }} {%- endif -%}\r\n {% endif %}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7805939, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7812188, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.782116, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7847788, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7852447, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7860212, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.786749, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7872517, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7877283, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return('') }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7885392, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7895055, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7898, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.790391, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.791187, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7915545, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.792161, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.792928, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7934082, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.793616, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7942061, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7946587, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7953763, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7959723, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7965486, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7968738, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.797239, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7976983, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7983692, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.7987227, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.798951, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8005598, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8047006, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.808808, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8099217, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.810478, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8108606, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8138814, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8155847, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8163893, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8177607, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8182986, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8187299, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8208725, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8212132, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8217897, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% set column_list = column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8225286, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8229685, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.823263, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8236592, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8241062, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.824636, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.825115, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.825505, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8258636, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.828044, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8289528, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.829129, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8295908, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8298762, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8300724, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8303144, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.830475, "supported_languages": null}, "macro.dbt_date.day_of_year": {"name": "day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.day_of_year", "macro_sql": "{%- macro day_of_year(date) -%}\n{{ adapter.dispatch('day_of_year', 'dbt_date') (date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__day_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8478096, "supported_languages": null}, "macro.dbt_date.default__day_of_year": {"name": "default__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.default__day_of_year", "macro_sql": "\n\n{%- macro default__day_of_year(date) -%}\n {{ dbt_date.date_part('dayofyear', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8479664, "supported_languages": null}, "macro.dbt_date.postgres__day_of_year": {"name": "postgres__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.postgres__day_of_year", "macro_sql": "\n\n{%- macro postgres__day_of_year(date) -%}\n {{ dbt_date.date_part('doy', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8481202, "supported_languages": null}, "macro.dbt_date.redshift__day_of_year": {"name": "redshift__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.redshift__day_of_year", "macro_sql": "\n\n{%- macro redshift__day_of_year(date) -%}\n cast({{ dbt_date.date_part('dayofyear', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8483179, "supported_languages": null}, "macro.dbt_date.spark__day_of_year": {"name": "spark__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.spark__day_of_year", "macro_sql": "\n\n{%- macro spark__day_of_year(date) -%}\n dayofyear({{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8484259, "supported_languages": null}, "macro.dbt_date.trino__day_of_year": {"name": "trino__day_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_year.sql", "original_file_path": "macros/calendar_date/day_of_year.sql", "unique_id": "macro.dbt_date.trino__day_of_year", "macro_sql": "\n\n{%- macro trino__day_of_year(date) -%}\n {{ dbt_date.date_part('day_of_year', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8485677, "supported_languages": null}, "macro.dbt_date.day_of_month": {"name": "day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.day_of_month", "macro_sql": "{%- macro day_of_month(date) -%}\n{{ dbt_date.date_part('day', date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8505104, "supported_languages": null}, "macro.dbt_date.redshift__day_of_month": {"name": "redshift__day_of_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_month.sql", "original_file_path": "macros/calendar_date/day_of_month.sql", "unique_id": "macro.dbt_date.redshift__day_of_month", "macro_sql": "\n\n{%- macro redshift__day_of_month(date) -%}\ncast({{ dbt_date.date_part('day', date) }} as {{ dbt.type_bigint() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8506973, "supported_languages": null}, "macro.dbt_date.round_timestamp": {"name": "round_timestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/round_timestamp.sql", "original_file_path": "macros/calendar_date/round_timestamp.sql", "unique_id": "macro.dbt_date.round_timestamp", "macro_sql": "{% macro round_timestamp(timestamp) %}\n {{ dbt.date_trunc(\"day\", dbt.dateadd(\"hour\", 12, timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8538115, "supported_languages": null}, "macro.dbt_date.date_part": {"name": "date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.date_part", "macro_sql": "{% macro date_part(datepart, date) -%}\n {{ adapter.dispatch('date_part', 'dbt_date') (datepart, date) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.854541, "supported_languages": null}, "macro.dbt_date.default__date_part": {"name": "default__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.default__date_part", "macro_sql": "{% macro default__date_part(datepart, date) -%}\n date_part('{{ datepart }}', {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8546774, "supported_languages": null}, "macro.dbt_date.bigquery__date_part": {"name": "bigquery__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.bigquery__date_part", "macro_sql": "{% macro bigquery__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.85481, "supported_languages": null}, "macro.dbt_date.trino__date_part": {"name": "trino__date_part", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/date_part.sql", "original_file_path": "macros/calendar_date/date_part.sql", "unique_id": "macro.dbt_date.trino__date_part", "macro_sql": "{% macro trino__date_part(datepart, date) -%}\n extract({{ datepart }} from {{ date }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8549433, "supported_languages": null}, "macro.dbt_date.day_of_week": {"name": "day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.day_of_week", "macro_sql": "{%- macro day_of_week(date, isoweek=true) -%}\n{{ adapter.dispatch('day_of_week', 'dbt_date') (date, isoweek) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8577392, "supported_languages": null}, "macro.dbt_date.default__day_of_week": {"name": "default__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.default__day_of_week", "macro_sql": "\n\n{%- macro default__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else {{ dow }}\n end\n {%- else -%}\n {{ dow }} + 1\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8580701, "supported_languages": null}, "macro.dbt_date.snowflake__day_of_week": {"name": "snowflake__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.snowflake__day_of_week", "macro_sql": "\n\n{%- macro snowflake__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'dayofweekiso' -%}\n {{ dbt_date.date_part(dow_part, date) }}\n {%- else -%}\n {%- set dow_part = 'dayofweek' -%}\n case\n when {{ dbt_date.date_part(dow_part, date) }} = 7 then 1\n else {{ dbt_date.date_part(dow_part, date) }} + 1\n end\n {%- endif -%}\n\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8584945, "supported_languages": null}, "macro.dbt_date.bigquery__day_of_week": {"name": "bigquery__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.bigquery__day_of_week", "macro_sql": "\n\n{%- macro bigquery__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (1) to Monday (2)\n when {{ dow }} = 1 then 7\n else {{ dow }} - 1\n end\n {%- else -%}\n {{ dow }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.858958, "supported_languages": null}, "macro.dbt_date.postgres__day_of_week": {"name": "postgres__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.postgres__day_of_week", "macro_sql": "\n\n\n{%- macro postgres__day_of_week(date, isoweek) -%}\n\n {%- if isoweek -%}\n {%- set dow_part = 'isodow' -%}\n -- Monday(1) to Sunday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} as {{ dbt.type_int() }})\n {%- else -%}\n {%- set dow_part = 'dow' -%}\n -- Sunday(1) to Saturday (7)\n cast({{ dbt_date.date_part(dow_part, date) }} + 1 as {{ dbt.type_int() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8594937, "supported_languages": null}, "macro.dbt_date.redshift__day_of_week": {"name": "redshift__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.redshift__day_of_week", "macro_sql": "\n\n\n{%- macro redshift__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('dayofweek', date) -%}\n\n {%- if isoweek -%}\n case\n -- Shift start of week from Sunday (0) to Monday (1)\n when {{ dow }} = 0 then 7\n else cast({{ dow }} as {{ dbt.type_bigint() }})\n end\n {%- else -%}\n cast({{ dow }} + 1 as {{ dbt.type_bigint() }})\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8599114, "supported_languages": null}, "macro.dbt_date.duckdb__day_of_week": {"name": "duckdb__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.duckdb__day_of_week", "macro_sql": "\n\n{%- macro duckdb__day_of_week(date, isoweek) -%}\n{{ return(dbt_date.postgres__day_of_week(date, isoweek)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__day_of_week"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8600986, "supported_languages": null}, "macro.dbt_date.spark__day_of_week": {"name": "spark__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.spark__day_of_week", "macro_sql": "\n\n\n{%- macro spark__day_of_week(date, isoweek) -%}\n\n {%- set dow = \"dayofweek_iso\" if isoweek else \"dayofweek\" -%}\n\n {{ dbt_date.date_part(dow, date) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8603287, "supported_languages": null}, "macro.dbt_date.trino__day_of_week": {"name": "trino__day_of_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_of_week.sql", "original_file_path": "macros/calendar_date/day_of_week.sql", "unique_id": "macro.dbt_date.trino__day_of_week", "macro_sql": "\n\n\n{%- macro trino__day_of_week(date, isoweek) -%}\n\n {%- set dow = dbt_date.date_part('day_of_week', date) -%}\n\n {%- if isoweek -%}\n {{ dow }}\n {%- else -%}\n case\n when {{ dow }} = 7 then 1\n else {{ dow }} + 1\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8606167, "supported_languages": null}, "macro.dbt_date.month_name": {"name": "month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.month_name", "macro_sql": "{%- macro month_name(date, short=True) -%}\n {{ adapter.dispatch('month_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__month_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8612316, "supported_languages": null}, "macro.dbt_date.default__month_name": {"name": "default__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.default__month_name", "macro_sql": "\n\n{%- macro default__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MONTH' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8614295, "supported_languages": null}, "macro.dbt_date.bigquery__month_name": {"name": "bigquery__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.bigquery__month_name", "macro_sql": "\n\n{%- macro bigquery__month_name(date, short) -%}\n{%- set f = '%b' if short else '%B' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.861671, "supported_languages": null}, "macro.dbt_date.snowflake__month_name": {"name": "snowflake__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.snowflake__month_name", "macro_sql": "\n\n{%- macro snowflake__month_name(date, short) -%}\n{%- set f = 'MON' if short else 'MMMM' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.861925, "supported_languages": null}, "macro.dbt_date.postgres__month_name": {"name": "postgres__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.postgres__month_name", "macro_sql": "\n\n{%- macro postgres__month_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMMon' if short else 'FMMonth' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.862187, "supported_languages": null}, "macro.dbt_date.duckdb__month_name": {"name": "duckdb__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.duckdb__month_name", "macro_sql": "\n\n\n{%- macro duckdb__month_name(date, short) -%}\n {%- if short -%}\n substr(monthname({{ date }}), 1, 3)\n {%- else -%}\n monthname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8624423, "supported_languages": null}, "macro.dbt_date.spark__month_name": {"name": "spark__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.spark__month_name", "macro_sql": "\n\n{%- macro spark__month_name(date, short) -%}\n{%- set f = 'MMM' if short else 'MMMM' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8626645, "supported_languages": null}, "macro.dbt_date.trino__month_name": {"name": "trino__month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/month_name.sql", "original_file_path": "macros/calendar_date/month_name.sql", "unique_id": "macro.dbt_date.trino__month_name", "macro_sql": "\n\n{%- macro trino__month_name(date, short) -%}\n{%- set f = 'b' if short else 'M' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8628862, "supported_languages": null}, "macro.dbt_date.convert_timezone": {"name": "convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.convert_timezone", "macro_sql": "{%- macro convert_timezone(column, target_tz=None, source_tz=None) -%}\n{%- set source_tz = \"UTC\" if not source_tz else source_tz -%}\n{%- set target_tz = var(\"dbt_date:time_zone\") if not target_tz else target_tz -%}\n{{ adapter.dispatch('convert_timezone', 'dbt_date') (column, target_tz, source_tz) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.duckdb__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8640497, "supported_languages": null}, "macro.dbt_date.default__convert_timezone": {"name": "default__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.default__convert_timezone", "macro_sql": "{% macro default__convert_timezone(column, target_tz, source_tz) -%}\nconvert_timezone('{{ source_tz }}', '{{ target_tz }}',\n cast({{ column }} as {{ dbt.type_timestamp() }})\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8642724, "supported_languages": null}, "macro.dbt_date.bigquery__convert_timezone": {"name": "bigquery__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.bigquery__convert_timezone", "macro_sql": "{%- macro bigquery__convert_timezone(column, target_tz, source_tz=None) -%}\ntimestamp(datetime({{ column }}, '{{ target_tz}}'))\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8644342, "supported_languages": null}, "macro.dbt_date.postgres__convert_timezone": {"name": "postgres__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.postgres__convert_timezone", "macro_sql": "{% macro postgres__convert_timezone(column, target_tz, source_tz) -%}\ncast(\n cast({{ column }} as {{ dbt.type_timestamp() }})\n at time zone '{{ source_tz }}' at time zone '{{ target_tz }}' as {{ dbt.type_timestamp() }}\n)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8646832, "supported_languages": null}, "macro.dbt_date.redshift__convert_timezone": {"name": "redshift__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.redshift__convert_timezone", "macro_sql": "{%- macro redshift__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.default__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.default__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8648863, "supported_languages": null}, "macro.dbt_date.duckdb__convert_timezone": {"name": "duckdb__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.duckdb__convert_timezone", "macro_sql": "{% macro duckdb__convert_timezone(column, target_tz, source_tz) -%}\n{{ return(dbt_date.postgres__convert_timezone(column, target_tz, source_tz)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.postgres__convert_timezone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.865083, "supported_languages": null}, "macro.dbt_date.spark__convert_timezone": {"name": "spark__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.spark__convert_timezone", "macro_sql": "{%- macro spark__convert_timezone(column, target_tz, source_tz) -%}\nfrom_utc_timestamp(\n to_utc_timestamp({{ column }}, '{{ source_tz }}'),\n '{{ target_tz }}'\n )\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8652608, "supported_languages": null}, "macro.dbt_date.trino__convert_timezone": {"name": "trino__convert_timezone", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/convert_timezone.sql", "original_file_path": "macros/calendar_date/convert_timezone.sql", "unique_id": "macro.dbt_date.trino__convert_timezone", "macro_sql": "{%- macro trino__convert_timezone(column, target_tz, source_tz) -%}\n cast((at_timezone(with_timezone(cast({{ column }} as {{ dbt.type_timestamp() }}), '{{ source_tz }}'), '{{ target_tz }}')) as {{ dbt.type_timestamp() }})\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.865519, "supported_languages": null}, "macro.dbt_date.from_unixtimestamp": {"name": "from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.from_unixtimestamp", "macro_sql": "{%- macro from_unixtimestamp(epochs, format=\"seconds\") -%}\n {{ adapter.dispatch('from_unixtimestamp', 'dbt_date') (epochs, format) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__from_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.867914, "supported_languages": null}, "macro.dbt_date.default__from_unixtimestamp": {"name": "default__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__from_unixtimestamp", "macro_sql": "\n\n{%- macro default__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp({{ epochs }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.868182, "supported_languages": null}, "macro.dbt_date.postgres__from_unixtimestamp": {"name": "postgres__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.postgres__from_unixtimestamp", "macro_sql": "\n\n{%- macro postgres__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8684485, "supported_languages": null}, "macro.dbt_date.snowflake__from_unixtimestamp": {"name": "snowflake__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__from_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n {%- set scale = 0 -%}\n {%- elif format == \"milliseconds\" -%}\n {%- set scale = 3 -%}\n {%- elif format == \"microseconds\" -%}\n {%- set scale = 6 -%}\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n to_timestamp_ntz({{ epochs }}, {{ scale }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.869014, "supported_languages": null}, "macro.dbt_date.bigquery__from_unixtimestamp": {"name": "bigquery__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__from_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n timestamp_seconds({{ epochs }})\n {%- elif format == \"milliseconds\" -%}\n timestamp_millis({{ epochs }})\n {%- elif format == \"microseconds\" -%}\n timestamp_micros({{ epochs }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.869407, "supported_languages": null}, "macro.dbt_date.trino__from_unixtimestamp": {"name": "trino__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__from_unixtimestamp", "macro_sql": "\n\n{%- macro trino__from_unixtimestamp(epochs, format) -%}\n {%- if format == \"seconds\" -%}\n cast(from_unixtime({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"milliseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 6)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"microseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }} * pow(10, 3)) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- elif format == \"nanoseconds\" -%}\n cast(from_unixtime_nanos({{ epochs }}) AT TIME ZONE 'UTC' as {{ dbt.type_timestamp() }})\n {%- else -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8700259, "supported_languages": null}, "macro.dbt_date.duckdb__from_unixtimestamp": {"name": "duckdb__from_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/from_unixtimestamp.sql", "original_file_path": "macros/calendar_date/from_unixtimestamp.sql", "unique_id": "macro.dbt_date.duckdb__from_unixtimestamp", "macro_sql": "\n\n\n{%- macro duckdb__from_unixtimestamp(epochs, format=\"seconds\") -%}\n {%- if format != \"seconds\" -%}\n {{ exceptions.raise_compiler_error(\n \"value \" ~ format ~ \" for `format` for from_unixtimestamp is not supported.\"\n )\n }}\n {% endif -%}\n cast(to_timestamp({{ epochs }}) at time zone 'UTC' as timestamp)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8702855, "supported_languages": null}, "macro.dbt_date.day_name": {"name": "day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.day_name", "macro_sql": "{%- macro day_name(date, short=True) -%}\n {{ adapter.dispatch('day_name', 'dbt_date') (date, short) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.duckdb__day_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.871002, "supported_languages": null}, "macro.dbt_date.default__day_name": {"name": "default__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.default__day_name", "macro_sql": "\n\n{%- macro default__day_name(date, short) -%}\n{%- set f = 'Dy' if short else 'Day' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8712003, "supported_languages": null}, "macro.dbt_date.snowflake__day_name": {"name": "snowflake__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.snowflake__day_name", "macro_sql": "\n\n{%- macro snowflake__day_name(date, short) -%}\n {%- if short -%}\n dayname({{ date }})\n {%- else -%}\n -- long version not implemented on Snowflake so we're doing it manually :/\n case dayname({{ date }})\n when 'Mon' then 'Monday'\n when 'Tue' then 'Tuesday'\n when 'Wed' then 'Wednesday'\n when 'Thu' then 'Thursday'\n when 'Fri' then 'Friday'\n when 'Sat' then 'Saturday'\n when 'Sun' then 'Sunday'\n end\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8714106, "supported_languages": null}, "macro.dbt_date.bigquery__day_name": {"name": "bigquery__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.bigquery__day_name", "macro_sql": "\n\n{%- macro bigquery__day_name(date, short) -%}\n{%- set f = '%a' if short else '%A' -%}\n format_date('{{ f }}', cast({{ date }} as date))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8716178, "supported_languages": null}, "macro.dbt_date.postgres__day_name": {"name": "postgres__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.postgres__day_name", "macro_sql": "\n\n{%- macro postgres__day_name(date, short) -%}\n{# FM = Fill mode, which suppresses padding blanks #}\n{%- set f = 'FMDy' if short else 'FMDay' -%}\n to_char({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8718271, "supported_languages": null}, "macro.dbt_date.duckdb__day_name": {"name": "duckdb__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.duckdb__day_name", "macro_sql": "\n\n{%- macro duckdb__day_name(date, short) -%}\n {%- if short -%}\n substr(dayname({{ date }}), 1, 3)\n {%- else -%}\n dayname({{ date }})\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8720245, "supported_languages": null}, "macro.dbt_date.spark__day_name": {"name": "spark__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.spark__day_name", "macro_sql": "\n\n{%- macro spark__day_name(date, short) -%}\n{%- set f = 'E' if short else 'EEEE' -%}\n date_format({{ date }}, '{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8722267, "supported_languages": null}, "macro.dbt_date.trino__day_name": {"name": "trino__day_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/day_name.sql", "original_file_path": "macros/calendar_date/day_name.sql", "unique_id": "macro.dbt_date.trino__day_name", "macro_sql": "\n\n{%- macro trino__day_name(date, short) -%}\n{%- set f = 'a' if short else 'W' -%}\n date_format({{ date }}, '%{{ f }}')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8724246, "supported_languages": null}, "macro.dbt_date.to_unixtimestamp": {"name": "to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.to_unixtimestamp", "macro_sql": "{%- macro to_unixtimestamp(timestamp) -%}\n {{ adapter.dispatch('to_unixtimestamp', 'dbt_date') (timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__to_unixtimestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8730087, "supported_languages": null}, "macro.dbt_date.default__to_unixtimestamp": {"name": "default__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.default__to_unixtimestamp", "macro_sql": "\n\n{%- macro default__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.873151, "supported_languages": null}, "macro.dbt_date.snowflake__to_unixtimestamp": {"name": "snowflake__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.snowflake__to_unixtimestamp", "macro_sql": "\n\n{%- macro snowflake__to_unixtimestamp(timestamp) -%}\n {{ dbt_date.date_part('epoch_seconds', timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8733017, "supported_languages": null}, "macro.dbt_date.bigquery__to_unixtimestamp": {"name": "bigquery__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.bigquery__to_unixtimestamp", "macro_sql": "\n\n{%- macro bigquery__to_unixtimestamp(timestamp) -%}\n unix_seconds({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.873419, "supported_languages": null}, "macro.dbt_date.spark__to_unixtimestamp": {"name": "spark__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.spark__to_unixtimestamp", "macro_sql": "\n\n{%- macro spark__to_unixtimestamp(timestamp) -%}\n unix_timestamp({{ timestamp }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8735332, "supported_languages": null}, "macro.dbt_date.trino__to_unixtimestamp": {"name": "trino__to_unixtimestamp", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/to_unixtimestamp.sql", "original_file_path": "macros/calendar_date/to_unixtimestamp.sql", "unique_id": "macro.dbt_date.trino__to_unixtimestamp", "macro_sql": "\n\n{%- macro trino__to_unixtimestamp(timestamp) -%}\n to_unixtime({{ timestamp }} AT TIME ZONE 'UTC')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8736491, "supported_languages": null}, "macro.dbt_date.get_fiscal_periods": {"name": "get_fiscal_periods", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_periods.sql", "original_file_path": "macros/fiscal_date/get_fiscal_periods.sql", "unique_id": "macro.dbt_date.get_fiscal_periods", "macro_sql": "{% macro get_fiscal_periods(dates, year_end_month, week_start_day, shift_year=1) %}\n{#\nThis macro requires you to pass in a ref to a date dimension, created via\ndbt_date.get_date_dimension()s\n#}\nwith fscl_year_dates_for_periods as (\n {{ dbt_date.get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) }}\n),\nfscl_year_w13 as (\n\n select\n f.*,\n -- We count the weeks in a 13 week period\n -- and separate the 4-5-4 week sequences\n mod(cast(\n (f.fiscal_week_of_year-1) as {{ dbt.type_int() }}\n ), 13) as w13_number,\n -- Chop weeks into 13 week merch quarters\n cast(\n least(\n floor((f.fiscal_week_of_year-1)/13.0)\n , 3)\n as {{ dbt.type_int() }}) as quarter_number\n from\n fscl_year_dates_for_periods f\n\n),\nfscl_periods as (\n\n select\n f.date_day,\n f.fiscal_year_number,\n f.week_start_date,\n f.week_end_date,\n f.fiscal_week_of_year,\n case\n -- we move week 53 into the 3rd period of the quarter\n when f.fiscal_week_of_year = 53 then 3\n when f.w13_number between 0 and 3 then 1\n when f.w13_number between 4 and 8 then 2\n when f.w13_number between 9 and 12 then 3\n end as period_of_quarter,\n f.quarter_number\n from\n fscl_year_w13 f\n\n),\nfscl_periods_quarters as (\n\n select\n f.*,\n cast((\n (f.quarter_number * 3) + f.period_of_quarter\n ) as {{ dbt.type_int() }}) as fiscal_period_number\n from\n fscl_periods f\n\n)\nselect\n date_day,\n fiscal_year_number,\n week_start_date,\n week_end_date,\n fiscal_week_of_year,\n dense_rank() over(partition by fiscal_period_number order by fiscal_week_of_year) as fiscal_week_of_period,\n fiscal_period_number,\n quarter_number+1 as fiscal_quarter_number,\n period_of_quarter as fiscal_period_of_quarter\nfrom\n fscl_periods_quarters\norder by 1,2\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_fiscal_year_dates", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8794851, "supported_languages": null}, "macro.dbt_date.get_fiscal_year_dates": {"name": "get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.get_fiscal_year_dates", "macro_sql": "{% macro get_fiscal_year_dates(dates, year_end_month=12, week_start_day=1, shift_year=1) %}\n{{ adapter.dispatch('get_fiscal_year_dates', 'dbt_date') (dates, year_end_month, week_start_day, shift_year) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_fiscal_year_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8808777, "supported_languages": null}, "macro.dbt_date.default__get_fiscal_year_dates": {"name": "default__get_fiscal_year_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/fiscal_date/get_fiscal_year_dates.sql", "original_file_path": "macros/fiscal_date/get_fiscal_year_dates.sql", "unique_id": "macro.dbt_date.default__get_fiscal_year_dates", "macro_sql": "{% macro default__get_fiscal_year_dates(dates, year_end_month, week_start_day, shift_year) %}\n-- this gets all the dates within a fiscal year\n-- determined by the given year-end-month\n-- ending on the saturday closest to that month's end date\nwith fsc_date_dimension as (\n select * from {{ dates }}\n),\nyear_month_end as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.month_end_date\n from\n fsc_date_dimension d\n where\n d.month_of_year = {{ year_end_month }}\n group by 1,2\n\n),\nweeks as (\n\n select\n d.year_number,\n d.month_of_year,\n d.date_day as week_start_date,\n cast({{ dbt.dateadd('day', 6, 'd.date_day') }} as date) as week_end_date\n from\n fsc_date_dimension d\n where\n d.day_of_week = {{ week_start_day }}\n\n),\n-- get all the weeks that start in the month the year ends\nyear_week_ends as (\n\n select\n d.year_number - {{ shift_year }} as fiscal_year_number,\n d.week_end_date\n from\n weeks d\n where\n d.month_of_year = {{ year_end_month }}\n group by\n 1,2\n\n),\n-- then calculate which Saturday is closest to month end\nweeks_at_month_end as (\n\n select\n d.fiscal_year_number,\n d.week_end_date,\n m.month_end_date,\n rank() over\n (partition by d.fiscal_year_number\n order by\n abs({{ dbt.datediff('d.week_end_date', 'm.month_end_date', 'day') }})\n\n ) as closest_to_month_end\n from\n year_week_ends d\n join\n year_month_end m on d.fiscal_year_number = m.fiscal_year_number\n),\nfiscal_year_range as (\n\n select\n w.fiscal_year_number,\n cast(\n {{ dbt.dateadd('day', 1,\n 'lag(w.week_end_date) over(order by w.week_end_date)') }}\n as date) as fiscal_year_start_date,\n w.week_end_date as fiscal_year_end_date\n from\n weeks_at_month_end w\n where\n w.closest_to_month_end = 1\n\n),\nfiscal_year_dates as (\n\n select\n d.date_day,\n m.fiscal_year_number,\n m.fiscal_year_start_date,\n m.fiscal_year_end_date,\n w.week_start_date,\n w.week_end_date,\n -- we reset the weeks of the year starting with the merch year start date\n dense_rank()\n over(\n partition by m.fiscal_year_number\n order by w.week_start_date\n ) as fiscal_week_of_year\n from\n fsc_date_dimension d\n join\n fiscal_year_range m on d.date_day between m.fiscal_year_start_date and m.fiscal_year_end_date\n join\n weeks w on d.date_day between w.week_start_date and w.week_end_date\n\n)\nselect * from fiscal_year_dates order by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8815122, "supported_languages": null}, "macro.dbt_date.date": {"name": "date", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(modules.datetime.date(year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8818643, "supported_languages": null}, "macro.dbt_date.datetime": {"name": "datetime", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/modules_datetime.sql", "original_file_path": "macros/_utils/modules_datetime.sql", "unique_id": "macro.dbt_date.datetime", "macro_sql": "{% macro datetime(year, month, day, hour=0, minute=0, second=0, microsecond=0, tz=None) %}\n {% set tz = tz if tz else var(\"dbt_date:time_zone\") %}\n {{ return(\n modules.datetime.datetime(\n year=year, month=month, day=day, hour=hour,\n minute=minute, second=second, microsecond=microsecond,\n tzinfo=modules.pytz.timezone(tz)\n )\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8824742, "supported_languages": null}, "macro.dbt_date.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8832152, "supported_languages": null}, "macro.dbt_date.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8836327, "supported_languages": null}, "macro.dbt_date.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_date')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8838165, "supported_languages": null}, "macro.dbt_date.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/generate_series.sql", "original_file_path": "macros/_utils/generate_series.sql", "unique_id": "macro.dbt_date.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_date.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8843446, "supported_languages": null}, "macro.dbt_date.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_date')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8849876, "supported_languages": null}, "macro.dbt_date.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8855903, "supported_languages": null}, "macro.dbt_date.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_date')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8858185, "supported_languages": null}, "macro.dbt_date.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/_utils/date_spine.sql", "original_file_path": "macros/_utils/date_spine.sql", "unique_id": "macro.dbt_date.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{\n dbt_date.generate_series(\n dbt_date.get_intervals_between(start_date, end_date, datepart)\n )\n }}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"(row_number() over (order by 1) - 1)\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.generate_series", "macro.dbt_date.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8861806, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than": {"name": "test_expect_column_distinct_count_to_be_less_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_less_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_less_than", "macro_sql": "{% test expect_column_distinct_count_to_be_less_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) < {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.886746, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set": {"name": "test_expect_column_distinct_values_to_equal_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_equal_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_equal_set", "macro_sql": "{% test expect_column_distinct_values_to_equal_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as column_value\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n all_values v\n full outer join\n unique_set_values s on v.column_value = s.value_field\n where\n v.column_value is null or\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8876815, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_mean_to_be_between": {"name": "test_expect_column_mean_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_mean_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_mean_to_be_between", "macro_sql": "{% test expect_column_mean_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\navg({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8884034, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than": {"name": "test_expect_column_distinct_count_to_be_greater_than", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_be_greater_than.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_be_greater_than", "macro_sql": "{% test expect_column_distinct_count_to_be_greater_than(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) > {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8889673, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between": {"name": "test_expect_column_proportion_of_unique_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_proportion_of_unique_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_proportion_of_unique_values_to_be_between", "macro_sql": "{% test expect_column_proportion_of_unique_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncast(count(distinct {{ column_name }}) as {{ dbt.type_float() }})/count({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_float", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8898108, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_min_to_be_between": {"name": "test_expect_column_min_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_min_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_min_to_be_between", "macro_sql": "{% test expect_column_min_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmin({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8905165, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_sum_to_be_between": {"name": "test_expect_column_sum_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_sum_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_sum_to_be_between", "macro_sql": "{% test expect_column_sum_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nsum({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8912206, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table": {"name": "test_expect_column_distinct_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal_other_table", "macro_sql": "{% test expect_column_distinct_count_to_equal_other_table(model,\n compare_model,\n column_name,\n compare_column_name,\n row_condition=None,\n compare_row_condition=None\n ) %}\n{%- set expression -%}\ncount(distinct {{ column_name }})\n{%- endset -%}\n{%- set compare_expression -%}\n{%- if compare_column_name -%}\ncount(distinct {{ compare_column_name }})\n{%- else -%}\n{{ expression }}\n{%- endif -%}\n{%- endset -%}\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8919356, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set": {"name": "test_expect_column_distinct_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_be_in_set", "macro_sql": "{% test expect_column_distinct_values_to_be_in_set(model,\n column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n unique_set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.892797, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_count_to_equal": {"name": "test_expect_column_distinct_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_count_to_equal", "macro_sql": "{% test expect_column_distinct_count_to_equal(model,\n column_name,\n value,\n group_by=None,\n row_condition=None\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }}) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8933547, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set": {"name": "test_expect_column_distinct_values_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_distinct_values_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_distinct_values_to_contain_set", "macro_sql": "{% test expect_column_distinct_values_to_contain_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values in set that are not in the list of values from the model\n select\n s.value_field\n from\n unique_set_values s\n left join\n all_values v on s.value_field = v.value_field\n where\n v.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8942213, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between": {"name": "test_expect_column_quantile_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_quantile_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_quantile_values_to_be_between", "macro_sql": "{% test expect_column_quantile_values_to_be_between(model, column_name,\n quantile,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.percentile_cont(column_name, quantile) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.895013, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_max_to_be_between": {"name": "test_expect_column_max_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_max_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_max_to_be_between", "macro_sql": "{% test expect_column_max_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\nmax({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8957312, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_median_to_be_between": {"name": "test_expect_column_median_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_median_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_median_to_be_between", "macro_sql": "{% test expect_column_median_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.median(column_name) }}\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.median", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8964803, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between": {"name": "test_expect_column_unique_value_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_unique_value_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_unique_value_count_to_be_between", "macro_sql": "{% test expect_column_unique_value_count_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\ncount(distinct {{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8972242, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_stdev_to_be_between": {"name": "test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_stdev_to_be_between", "macro_sql": "{% test expect_column_stdev_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_column_stdev_to_be_between', 'dbt_expectations') (\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_stdev_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8986084, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between": {"name": "default__test_expect_column_stdev_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_stdev_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_stdev_to_be_between", "macro_sql": "{% macro default__test_expect_column_stdev_to_be_between(\n model, column_name,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) %}\n\n{% set expression %}\nstddev({{ column_name }})\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.8990061, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set": {"name": "test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% test expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values=True,\n data_type=\"decimal\",\n row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_column_most_common_value_to_be_in_set', 'dbt_expectations') (\n model, column_name, value_set, top_n, quote_values, data_type, row_condition\n ) }}\n\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9005294, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set": {"name": "default__test_expect_column_most_common_value_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "original_file_path": "macros/schema_tests/aggregate_functions/expect_column_most_common_value_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_most_common_value_to_be_in_set", "macro_sql": "{% macro default__test_expect_column_most_common_value_to_be_in_set(model,\n column_name,\n value_set,\n top_n,\n quote_values,\n data_type,\n row_condition\n ) %}\n\nwith value_counts as (\n\n select\n {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %} as value_field,\n count(*) as value_count\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n group by {% if quote_values -%}\n {{ column_name }}\n {%- else -%}\n cast({{ column_name }} as {{ data_type }})\n {%- endif %}\n\n),\nvalue_counts_ranked as (\n\n select\n *,\n row_number() over(order by value_count desc) as value_count_rank\n from\n value_counts\n\n),\nvalue_count_top_n as (\n\n select\n value_field\n from\n value_counts_ranked\n where\n value_count_rank = {{ top_n }}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n '{{ value }}'\n {%- else -%}\n cast({{ value }} as {{ data_type }})\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n\n),\nunique_set_values as (\n\n select distinct value_field\n from\n set_values\n\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n value_field\n from\n value_count_top_n\n where\n value_field not in (select value_field from unique_set_values)\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9013507, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B": {"name": "test_expect_column_pair_values_A_to_be_greater_than_B", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_A_to_be_greater_than_B.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_A_to_be_greater_than_B", "macro_sql": "{% test expect_column_pair_values_A_to_be_greater_than_B(model,\n column_A,\n column_B,\n or_equal=False,\n row_condition=None\n ) %}\n\n{% set operator = \">=\" if or_equal else \">\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9020114, "supported_languages": null}, "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal": {"name": "test_expect_multicolumn_sum_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_multicolumn_sum_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_multicolumn_sum_to_equal", "macro_sql": "{% test expect_multicolumn_sum_to_equal(model,\n column_list,\n sum_total,\n group_by=None,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for column in column_list %}\nsum({{ column }}){% if not loop.last %} + {% endif %}\n{# the if just allows for column names or literal numbers #}\n{% endfor %} = {% if sum_total is number %}{{sum_total}}{% else %}sum({{ sum_total }}){% endif %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9029448, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal": {"name": "test_expect_column_pair_values_to_be_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_equal", "macro_sql": "{% test expect_column_pair_values_to_be_equal(model,\n column_A,\n column_B,\n row_condition=None\n ) %}\n\n{% set operator = \"=\" %}\n{% set expression = column_A ~ \" \" ~ operator ~ \" \" ~ column_B %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9035265, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set": {"name": "test_expect_column_pair_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/multi-column/expect_column_pair_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_pair_values_to_be_in_set", "macro_sql": "{% test expect_column_pair_values_to_be_in_set(model,\n column_A,\n column_B,\n value_pairs_set,\n row_condition=None\n ) %}\n\n{% set expression %}\n{% for pair in value_pairs_set %}\n{%- if (pair | length) == 2 %}\n({{ column_A }} = {{ pair[0] }} and {{ column_B }} = {{ pair[1] }}){% if not loop.last %} or {% endif %}\n{% else %}\n{{ exceptions.raise_compiler_error(\n \"`value_pairs_set` argument for expect_column_pair_values_to_be_in_set test cannot have more than 2 item per element.\n Got: '\" ~ pair ~ \"'.'\"\n ) }}\n{% endif %}\n{% endfor %}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9047477, "supported_languages": null}, "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record": {"name": "test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% test expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_select_column_values_to_be_unique_within_record', 'dbt_expectations') (model, column_list, quote_columns, ignore_row_if, row_condition) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9060702, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record": {"name": "default__test_expect_select_column_values_to_be_unique_within_record", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "original_file_path": "macros/schema_tests/multi-column/expect_select_column_values_to_be_unique_within_record.sql", "unique_id": "macro.dbt_expectations.default__test_expect_select_column_values_to_be_unique_within_record", "macro_sql": "{% macro default__test_expect_select_column_values_to_be_unique_within_record(model,\n column_list,\n quote_columns,\n ignore_row_if,\n row_condition\n ) %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith column_values as (\n\n select\n row_number() over(order by {{ columns|join(', ') }}) as row_index,\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n\n),\nunpivot_columns as (\n\n {% for column in columns %}\n select row_index, '{{ column }}' as column_name, {{ dbt_expectations.md5(column) }} as column_value from column_values\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n\n select\n row_index,\n count(distinct column_value) as column_values\n from unpivot_columns\n group by 1\n having count(distinct column_value) < {{ columns | length }}\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression", "macro.dbt_expectations.md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9073575, "supported_languages": null}, "macro.dbt_expectations.test_expect_compound_columns_to_be_unique": {"name": "test_expect_compound_columns_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "original_file_path": "macros/schema_tests/multi-column/expect_compound_columns_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_compound_columns_to_be_unique", "macro_sql": "{% test expect_compound_columns_to_be_unique(model,\n column_list,\n quote_columns=False,\n ignore_row_if=\"all_values_are_missing\",\n row_condition=None\n ) %}\n{% if not column_list %}\n {{ exceptions.raise_compiler_error(\n \"`column_list` must be specified as a list of columns. Got: '\" ~ column_list ~\"'.'\"\n ) }}\n{% endif %}\n\n{% if not quote_columns %}\n {%- set columns=column_list %}\n{% elif quote_columns %}\n {%- set columns=[] %}\n {% for column in column_list -%}\n {% set columns = columns.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for expect_compound_columns_to_be_unique test must be one of [True, False] Got: '\" ~ quote_columns ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set row_condition_ext -%}\n\n {%- if row_condition %}\n {{ row_condition }} and\n {% endif -%}\n\n {{ dbt_expectations.ignore_row_if_expression(ignore_row_if, columns) }}\n\n{%- endset -%}\n\nwith validation_errors as (\n\n select\n {% for column in columns -%}\n {{ column }},\n {%- endfor %}\n count(*) as {{adapter.quote(\"n_records\")}}\n from {{ model }}\n where\n 1=1\n {%- if row_condition_ext %}\n and {{ row_condition_ext }}\n {% endif %}\n group by\n {% for column in columns -%}\n {{ column }}{% if not loop.last %},{% endif %}\n {%- endfor %}\n having count(*) > 1\n\n)\nselect * from validation_errors\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9092526, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs": {"name": "test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by=None,\n sigma_threshold=3\n ) -%}\n {{\n adapter.dispatch('test_expect_column_values_to_be_within_n_stdevs', 'dbt_expectations') (\n model, column_name, group_by, sigma_threshold\n )\n }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9100351, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_stdevs(model,\n column_name,\n group_by,\n sigma_threshold\n ) %}\n\nwith metric_values as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as {{ column_name }}\n from\n {{ model }}\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n),\nmetric_values_with_statistics as (\n\n select\n *,\n avg({{ column_name }}) over() as {{ column_name }}_average,\n stddev({{ column_name }}) over() as {{ column_name }}_stddev\n from\n metric_values\n\n),\nmetric_values_z_scores as (\n\n select\n *,\n ({{ column_name }} - {{ column_name }}_average)/\n nullif({{ column_name }}_stddev, 0) as {{ column_name }}_sigma\n from\n metric_values_with_statistics\n\n)\nselect\n *\nfrom\n metric_values_z_scores\nwhere\n abs({{ column_name }}_sigma) > {{ sigma_threshold }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9106, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table_times_factor',\n 'dbt_expectations') (model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9211695, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor": {"name": "default__test_expect_table_row_count_to_equal_other_table_times_factor", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table_times_factor.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table_times_factor", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table_times_factor(model,\n compare_model,\n factor,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition\n ) -%}\n\n{{ dbt_expectations.test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=group_by,\n compare_group_by=compare_group_by,\n factor=factor,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.921475, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_be_between": {"name": "test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_be_between", "macro_sql": "{%- test expect_table_row_count_to_be_between(model,\n min_value=None,\n max_value=None,\n group_by=None,\n row_condition=None,\n strictly=False\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_be_between',\n 'dbt_expectations') (model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_be_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9222558, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between": {"name": "default__test_expect_table_row_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_be_between", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_be_between(model,\n min_value,\n max_value,\n group_by,\n row_condition,\n strictly\n ) -%}\n{% set expression %}\ncount(*)\n{% endset %}\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=group_by,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.922604, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table": {"name": "test_expect_table_column_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal_other_table", "macro_sql": "{%- test expect_table_column_count_to_equal_other_table(model, compare_model) -%}\n{%- if execute -%}\n{%- set number_columns = (adapter.get_columns_in_relation(model) | length) -%}\n{%- set compare_number_columns = (adapter.get_columns_in_relation(compare_model) | length) -%}\nwith test_data as (\n\n select\n {{ number_columns }} as number_columns,\n {{ compare_number_columns }} as compare_number_columns\n\n)\nselect *\nfrom test_data\nwhere\n number_columns != compare_number_columns\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.923071, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_contain_set": {"name": "test_expect_table_columns_to_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_contain_set", "macro_sql": "{%- test expect_table_columns_to_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n input_columns i\n left join\n relation_columns r on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n r.relation_column is null\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9241962, "supported_languages": null}, "macro.dbt_expectations._list_intersect": {"name": "_list_intersect", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_list_intersect.sql", "original_file_path": "macros/schema_tests/table_shape/_list_intersect.sql", "unique_id": "macro.dbt_expectations._list_intersect", "macro_sql": "{%- macro _list_intersect(list1, list2) -%}\n{%- set matching_items = [] -%}\n{%- for itm in list1 -%}\n {%- if itm in list2 -%}\n {%- do matching_items.append(itm) -%}\n {%- endif -%}\n{%- endfor -%}\n{%- do return(matching_items) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9246168, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_equal": {"name": "test_expect_table_column_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_equal", "macro_sql": "{%- test expect_table_column_count_to_equal(model, value) -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ value }} as value\n\n)\nselect *\nfrom test_data\nwhere\n number_actual_columns != value\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9249802, "supported_languages": null}, "macro.dbt_expectations._get_column_list": {"name": "_get_column_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/_get_column_list.sql", "original_file_path": "macros/schema_tests/table_shape/_get_column_list.sql", "unique_id": "macro.dbt_expectations._get_column_list", "macro_sql": "{%- macro _get_column_list(model, transform=\"upper\") -%}\n{%- set relation_columns = adapter.get_columns_in_relation(model) -%}\n{%- set relation_column_names = relation_columns | map(attribute=\"name\") | map(transform) | list -%}\n{%- do return(relation_column_names) -%}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9253695, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal": {"name": "test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal", "macro_sql": "{%- test expect_table_row_count_to_equal(model,\n value,\n group_by=None,\n row_condition=None\n ) -%}\n {{ adapter.dispatch('test_expect_table_row_count_to_equal',\n 'dbt_expectations') (model,\n value,\n group_by,\n row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9259686, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal": {"name": "default__test_expect_table_row_count_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal", "macro_sql": "\n\n\n\n{%- macro default__test_expect_table_row_count_to_equal(model,\n value,\n group_by,\n row_condition\n ) -%}\n{% set expression %}\ncount(*) = {{ value }}\n{% endset %}\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=group_by,\n row_condition=row_condition)\n }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9262612, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_to_exist": {"name": "test_expect_column_to_exist", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "original_file_path": "macros/schema_tests/table_shape/expect_column_to_exist.sql", "unique_id": "macro.dbt_expectations.test_expect_column_to_exist", "macro_sql": "{%- test expect_column_to_exist(model, column_name, column_index=None, transform=\"upper\") -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | map(transform) | join -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n\n {%- set matching_column_index = relation_column_names.index(column_name) if column_name in relation_column_names else -1 %}\n\n {%- if column_index -%}\n\n {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%}\n\n {%- set column_index_matches = true if matching_column_index == column_index_0 else false %}\n\n {%- else -%}\n\n {%- set column_index_matches = true -%}\n\n {%- endif %}\n\n with test_data as (\n\n select\n cast('{{ column_name }}' as {{ dbt.type_string() }}) as column_name,\n {{ matching_column_index }} as matching_column_index,\n {{ column_index_matches }} as column_index_matches\n\n )\n select *\n from test_data\n where\n not(matching_column_index >= 0 and column_index_matches)\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9273715, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_set": {"name": "test_expect_table_columns_to_match_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_set", "macro_sql": "{%- test expect_table_columns_to_match_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column\n where\n -- catch any column in input list that is not in the list of table columns\n -- or any table column that is not in the input list\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.928509, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table": {"name": "test_expect_table_aggregation_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_aggregation_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_aggregation_to_equal_other_table", "macro_sql": "{%- test expect_table_aggregation_to_equal_other_table(model,\n expression,\n compare_model,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n\n{{ dbt_expectations.test_equal_expression(\n model,\n expression=expression,\n compare_model=compare_model,\n compare_expression=compare_expression,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition,\n tolerance=tolerance,\n tolerance_percent=tolerance_percent\n) }}\n\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9321702, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list": {"name": "test_expect_table_columns_to_match_ordered_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_match_ordered_list.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_match_ordered_list", "macro_sql": "{%- test expect_table_columns_to_match_ordered_list(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select\n {{ loop.index }} as relation_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select\n {{ loop.index }} as input_column_idx,\n cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n select *\n from\n relation_columns r\n full outer join\n input_columns i on r.relation_column = i.input_column and r.relation_column_idx = i.input_column_idx\n where\n -- catch any column in input list that is not in the sequence of table columns\n -- or any table column that is not in the input sequence\n r.relation_column is null or\n i.input_column is null\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9335992, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table": {"name": "test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.test_expect_table_row_count_to_equal_other_table", "macro_sql": "{%- test expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by=None,\n compare_group_by=None,\n factor=1,\n row_condition=None,\n compare_row_condition=None\n ) -%}\n\n {{ adapter.dispatch('test_expect_table_row_count_to_equal_other_table',\n 'dbt_expectations') (model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.934489, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table": {"name": "default__test_expect_table_row_count_to_equal_other_table", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_row_count_to_equal_other_table.sql", "unique_id": "macro.dbt_expectations.default__test_expect_table_row_count_to_equal_other_table", "macro_sql": "\n\n{%- macro default__test_expect_table_row_count_to_equal_other_table(model,\n compare_model,\n group_by,\n compare_group_by,\n factor,\n row_condition,\n compare_row_condition\n ) -%}\n{{ dbt_expectations.test_equal_expression(model, \"count(*)\",\n compare_model=compare_model,\n compare_expression=\"count(*) * \" + factor|string,\n group_by=group_by,\n compare_group_by=compare_group_by,\n row_condition=row_condition,\n compare_row_condition=compare_row_condition\n) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9348469, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_column_count_to_be_between": {"name": "test_expect_table_column_count_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_column_count_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_table_column_count_to_be_between", "macro_sql": "{%- test expect_table_column_count_to_be_between(model,\n min_value=None,\n max_value=None\n ) -%}\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n{%- if execute -%}\n{%- set number_actual_columns = (adapter.get_columns_in_relation(model) | length) -%}\n\n{%- set expression %}\n( 1=1\n{%- if min_value %} and number_actual_columns >= min_value{% endif %}\n{%- if max_value %} and number_actual_columns <= max_value{% endif %}\n)\n{% endset -%}\n\nwith test_data as (\n\n select\n {{ number_actual_columns }} as number_actual_columns,\n {{ min_value if min_value else 0 }} as min_value,\n {{ max_value if max_value else 0 }} as max_value\n\n)\nselect *\nfrom test_data\nwhere\n not {{ expression }}\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.935849, "supported_languages": null}, "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set": {"name": "test_expect_table_columns_to_not_contain_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "original_file_path": "macros/schema_tests/table_shape/expect_table_columns_to_not_contain_set.sql", "unique_id": "macro.dbt_expectations.test_expect_table_columns_to_not_contain_set", "macro_sql": "{%- test expect_table_columns_to_not_contain_set(model, column_list, transform=\"upper\") -%}\n{%- if execute -%}\n {%- set column_list = column_list | map(transform) | list -%}\n {%- set relation_column_names = dbt_expectations._get_column_list(model, transform) -%}\n {%- set matching_columns = dbt_expectations._list_intersect(column_list, relation_column_names) -%}\n with relation_columns as (\n\n {% for col_name in relation_column_names %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as relation_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n input_columns as (\n\n {% for col_name in column_list %}\n select cast('{{ col_name }}' as {{ dbt.type_string() }}) as input_column\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n )\n -- catch any column in input list that is in the list of table columns\n select *\n from\n input_columns i\n inner join\n relation_columns r on r.relation_column = i.input_column\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations._get_column_list", "macro.dbt_expectations._list_intersect", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9387977, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list": {"name": "test_expect_column_values_to_not_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex_list", "macro_sql": "{% test expect_column_values_to_not_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{% for regex in regex_list %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{%- if not loop.last %}\n{{ \" and \" if match_on == \"all\" else \" or \"}}\n{% endif -%}\n{% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9398735, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_regex": {"name": "test_expect_column_values_to_not_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_regex", "macro_sql": "{% test expect_column_values_to_not_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} = 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9405658, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex": {"name": "test_expect_column_values_to_match_regex", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex", "macro_sql": "{% test expect_column_values_to_match_regex(model, column_name,\n regex,\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n{{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9412422, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern": {"name": "test_expect_column_values_to_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern", "macro_sql": "{% test expect_column_values_to_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9417813, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_regex_list": {"name": "test_expect_column_values_to_match_regex_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_regex_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_regex_list", "macro_sql": "{% test expect_column_values_to_match_regex_list(model, column_name,\n regex_list,\n match_on=\"any\",\n row_condition=None,\n is_raw=False,\n flags=\"\"\n ) %}\n\n{% set expression %}\n {% for regex in regex_list %}\n {{ dbt_expectations.regexp_instr(column_name, regex, is_raw=is_raw, flags=flags) }} > 0\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.regexp_instr", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.942923, "supported_languages": null}, "macro.dbt_expectations._get_like_pattern_expression": {"name": "_get_like_pattern_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "original_file_path": "macros/schema_tests/string_matching/_get_like_pattern_expression.sql", "unique_id": "macro.dbt_expectations._get_like_pattern_expression", "macro_sql": "{% macro _get_like_pattern_expression(column_name, like_pattern, positive) %}\n{{ column_name }} {{ \"not\" if not positive else \"\" }} like '{{ like_pattern }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.943208, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list": {"name": "test_expect_column_values_to_not_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9442077, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern": {"name": "test_expect_column_values_to_not_match_like_pattern", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_not_match_like_pattern.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_match_like_pattern", "macro_sql": "{% test expect_column_values_to_not_match_like_pattern(model, column_name,\n like_pattern,\n row_condition=None\n ) %}\n\n{% set expression = dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=False) %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9447074, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_equal": {"name": "test_expect_column_value_lengths_to_equal", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_equal.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_equal", "macro_sql": "{% test expect_column_value_lengths_to_equal(model, column_name,\n value,\n row_condition=None\n ) %}\n\n{% set expression = dbt.length(column_name) ~ \" = \" ~ value %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.945177, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between": {"name": "test_expect_column_value_lengths_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_value_lengths_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_value_lengths_to_be_between", "macro_sql": "{% test expect_column_value_lengths_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n{% set expression %}\n{{ dbt.length(column_name) }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.length", "macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9458745, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list": {"name": "test_expect_column_values_to_match_like_pattern_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "original_file_path": "macros/schema_tests/string_matching/expect_column_values_to_match_like_pattern_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_match_like_pattern_list", "macro_sql": "{% test expect_column_values_to_match_like_pattern_list(model, column_name,\n like_pattern_list,\n match_on=\"any\",\n row_condition=None\n ) %}\n\n{% set expression %}\n {% for like_pattern in like_pattern_list %}\n {{ dbt_expectations._get_like_pattern_expression(column_name, like_pattern, positive=True) }}\n {%- if not loop.last %}\n {{ \" and \" if match_on == \"all\" else \" or \"}}\n {% endif -%}\n {% endfor %}\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations._get_like_pattern_expression", "macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9467738, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list": {"name": "test_expect_column_values_to_be_in_type_list", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_type_list.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_type_list", "macro_sql": "{%- test expect_column_values_to_be_in_type_list(model, column_name, column_type_list) -%}\n{%- if execute -%}\n\n {%- set column_name = column_name | upper -%}\n {%- set columns_in_relation = adapter.get_columns_in_relation(model) -%}\n {%- set column_type_list = column_type_list| map(\"upper\") | list -%}\n with relation_columns as (\n\n {% for column in columns_in_relation %}\n select\n cast('{{ escape_single_quotes(column.name | upper) }}' as {{ dbt.type_string() }}) as relation_column,\n cast('{{ column.dtype | upper }}' as {{ dbt.type_string() }}) as relation_column_type\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n ),\n test_data as (\n\n select\n *\n from\n relation_columns\n where\n relation_column = '{{ column_name }}'\n and\n relation_column_type not in ('{{ column_type_list | join(\"', '\") }}')\n\n )\n select *\n from test_data\n\n{%- endif -%}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9477406, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_unique": {"name": "test_expect_column_values_to_be_unique", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_unique.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_unique", "macro_sql": "{% test expect_column_values_to_be_unique(model, column_name, row_condition=None) %}\n{{ dbt_expectations.test_expect_compound_columns_to_be_unique(model, [column_name], row_condition=row_condition) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_compound_columns_to_be_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9479759, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing": {"name": "test_expect_column_values_to_have_consistent_casing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_have_consistent_casing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_have_consistent_casing", "macro_sql": "{% test expect_column_values_to_have_consistent_casing(model, column_name, display_inconsistent_columns=False) %}\n\nwith test_data as (\n\n select\n distinct {{ column_name }} as distinct_values\n from\n {{ model }}\n\n ),\n {% if display_inconsistent_columns %}\n validation_errors as (\n\n select\n lower(distinct_values) as inconsistent_columns,\n count(distinct_values) as set_count_case_insensitive\n from\n test_data\n group by 1\n having\n count(distinct_values) > 1\n\n )\n select * from validation_errors\n {% else %}\n validation_errors as (\n\n select\n count(1) as set_count,\n count(distinct lower(distinct_values)) as set_count_case_insensitive\n from\n test_data\n\n )\n select *\n from\n validation_errors\n where\n set_count != set_count_case_insensitive\n {% endif %}\n {%- endtest -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.948353, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_null": {"name": "test_expect_column_values_to_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_null", "macro_sql": "{% test expect_column_values_to_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.948754, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set": {"name": "test_expect_column_values_to_not_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_in_set", "macro_sql": "{% test expect_column_values_to_not_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that match the set\n select\n v.value_field\n from\n all_values v\n join\n set_values s on v.value_field = s.value_field\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.949555, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_between": {"name": "test_expect_column_values_to_be_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_between.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_between", "macro_sql": "{% test expect_column_values_to_be_between(model, column_name,\n min_value=None,\n max_value=None,\n row_condition=None,\n strictly=False\n ) %}\n\n{% set expression %}\n{{ column_name }}\n{% endset %}\n\n{{ dbt_expectations.expression_between(model,\n expression=expression,\n min_value=min_value,\n max_value=max_value,\n group_by_columns=None,\n row_condition=row_condition,\n strictly=strictly\n ) }}\n\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.950206, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_of_type": {"name": "test_expect_column_values_to_be_of_type", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_of_type.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_of_type", "macro_sql": "{%- test expect_column_values_to_be_of_type(model, column_name, column_type) -%}\n{{ dbt_expectations.test_expect_column_values_to_be_in_type_list(model, column_name, [column_type]) }}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt_expectations.test_expect_column_values_to_be_in_type_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9504163, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_in_set": {"name": "test_expect_column_values_to_be_in_set", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_in_set.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_in_set", "macro_sql": "{% test expect_column_values_to_be_in_set(model, column_name,\n value_set,\n quote_values=True,\n row_condition=None\n ) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field\n\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nset_values as (\n\n {% for value in value_set -%}\n select\n {% if quote_values -%}\n cast('{{ value }}' as {{ dbt.type_string() }})\n {%- else -%}\n {{ value }}\n {%- endif %} as value_field\n {% if not loop.last %}union all{% endif %}\n {% endfor %}\n),\nvalidation_errors as (\n -- values from the model that are not in the set\n select\n v.value_field\n from\n all_values v\n left join\n set_values s on v.value_field = s.value_field\n where\n s.value_field is null\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.951443, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_not_be_null": {"name": "test_expect_column_values_to_not_be_null", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_not_be_null.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_not_be_null", "macro_sql": "{% test expect_column_values_to_not_be_null(model, column_name, row_condition=None) %}\n\n{% set expression = column_name ~ \" is not null\" %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression,\n group_by_columns=None,\n row_condition=row_condition\n )\n }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.951872, "supported_languages": null}, "macro.dbt_expectations.truth_expression": {"name": "truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.truth_expression", "macro_sql": "{% macro truth_expression(expression) %}\n {{ adapter.dispatch('truth_expression', 'dbt_expectations') (expression) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.954668, "supported_languages": null}, "macro.dbt_expectations.default__truth_expression": {"name": "default__truth_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_truth_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_truth_expression.sql", "unique_id": "macro.dbt_expectations.default__truth_expression", "macro_sql": "{% macro default__truth_expression(expression) %}\n {{ expression }} as expression\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9547868, "supported_languages": null}, "macro.dbt_expectations.get_select": {"name": "get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.get_select", "macro_sql": "{% macro get_select(model, expression, row_condition, group_by) -%}\n {{ adapter.dispatch('get_select', 'dbt_expectations') (model, expression, row_condition, group_by) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.959399, "supported_languages": null}, "macro.dbt_expectations.default__get_select": {"name": "default__get_select", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__get_select", "macro_sql": "\n\n{%- macro default__get_select(model, expression, row_condition, group_by) %}\n select\n {% if group_by %}\n {% for g in group_by -%}\n {{ g }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ expression }} as expression\n from\n {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by %}\n group by\n {% for g in group_by -%}\n {{ loop.index }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n{% endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9599504, "supported_languages": null}, "macro.dbt_expectations.test_equal_expression": {"name": "test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.test_equal_expression", "macro_sql": "{% test equal_expression(model, expression,\n compare_model=None,\n compare_expression=None,\n group_by=None,\n compare_group_by=None,\n row_condition=None,\n compare_row_condition=None,\n tolerance=0.0,\n tolerance_percent=None\n ) -%}\n\n {{ adapter.dispatch('test_equal_expression', 'dbt_expectations') (\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_equal_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9604, "supported_languages": null}, "macro.dbt_expectations.default__test_equal_expression": {"name": "default__test_equal_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/equal_expression.sql", "original_file_path": "macros/schema_tests/_generalized/equal_expression.sql", "unique_id": "macro.dbt_expectations.default__test_equal_expression", "macro_sql": "\n\n{%- macro default__test_equal_expression(\n model,\n expression,\n compare_model,\n compare_expression,\n group_by,\n compare_group_by,\n row_condition,\n compare_row_condition,\n tolerance,\n tolerance_percent) -%}\n\n {%- set compare_model = model if not compare_model else compare_model -%}\n {%- set compare_expression = expression if not compare_expression else compare_expression -%}\n {%- set compare_row_condition = row_condition if not compare_row_condition else compare_row_condition -%}\n {%- set compare_group_by = group_by if not compare_group_by else compare_group_by -%}\n\n {%- set n_cols = (group_by|length) if group_by else 0 %}\n with a as (\n {{ dbt_expectations.get_select(model, expression, row_condition, group_by) }}\n ),\n b as (\n {{ dbt_expectations.get_select(compare_model, compare_expression, compare_row_condition, compare_group_by) }}\n ),\n final as (\n\n select\n {% for i in range(1, n_cols + 1) -%}\n coalesce(a.col_{{ i }}, b.col_{{ i }}) as col_{{ i }},\n {% endfor %}\n a.expression,\n b.expression as compare_expression,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0)) as expression_difference,\n abs(coalesce(a.expression, 0) - coalesce(b.expression, 0))/\n nullif(a.expression * 1.0, 0) as expression_difference_percent\n from\n {% if n_cols > 0 %}\n a\n full outer join\n b on\n {% for i in range(1, n_cols + 1) -%}\n a.col_{{ i }} = b.col_{{ i }} {% if not loop.last %}and{% endif %}\n {% endfor -%}\n {% else %}\n a cross join b\n {% endif %}\n )\n -- DEBUG:\n -- select * from final\n select\n *\n from final\n where\n {% if tolerance_percent %}\n expression_difference_percent > {{ tolerance_percent }}\n {% else %}\n expression_difference > {{ tolerance }}\n {% endif %}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.get_select"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9616988, "supported_languages": null}, "macro.dbt_expectations.ignore_row_if_expression": {"name": "ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.ignore_row_if_expression", "macro_sql": "{% macro ignore_row_if_expression(ignore_row_if, columns) %}\n {{ adapter.dispatch('ignore_row_if_expression', 'dbt_expectations') (ignore_row_if, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__ignore_row_if_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9621842, "supported_languages": null}, "macro.dbt_expectations.default__ignore_row_if_expression": {"name": "default__ignore_row_if_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "original_file_path": "macros/schema_tests/_generalized/_ignore_row_if_expression.sql", "unique_id": "macro.dbt_expectations.default__ignore_row_if_expression", "macro_sql": "{% macro default__ignore_row_if_expression(ignore_row_if, columns) %}\n {%- set ignore_row_if_values = [\"all_values_are_missing\", \"any_value_is_missing\"] -%}\n {% if ignore_row_if not in ignore_row_if_values %}\n {{ exceptions.raise_compiler_error(\n \"`ignore_row_if` must be one of \" ~ (ignore_row_if_values | join(\", \")) ~ \". Got: '\" ~ ignore_row_if ~\"'.'\"\n ) }}\n {% endif %}\n\n {%- set op = \"and\" if ignore_row_if == \"all_values_are_missing\" else \"or\" -%}\n not (\n {% for column in columns -%}\n {{ column }} is null{% if not loop.last %} {{ op }} {% endif %}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9627671, "supported_languages": null}, "macro.dbt_expectations.test_expression_between": {"name": "test_expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.test_expression_between", "macro_sql": "{% test expression_between(model,\n expression,\n min_value=None,\n max_value=None,\n group_by_columns=None,\n row_condition=None,\n strictly=False\n ) %}\n\n {{ dbt_expectations.expression_between(model, expression, min_value, max_value, group_by_columns, row_condition, strictly) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9637437, "supported_languages": null}, "macro.dbt_expectations.expression_between": {"name": "expression_between", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_between.sql", "original_file_path": "macros/schema_tests/_generalized/expression_between.sql", "unique_id": "macro.dbt_expectations.expression_between", "macro_sql": "{% macro expression_between(model,\n expression,\n min_value,\n max_value,\n group_by_columns,\n row_condition,\n strictly\n ) %}\n\n{%- if min_value is none and max_value is none -%}\n{{ exceptions.raise_compiler_error(\n \"You have to provide either a min_value, max_value or both.\"\n) }}\n{%- endif -%}\n\n{%- set strict_operator = \"\" if strictly else \"=\" -%}\n\n{% set expression_min_max %}\n( 1=1\n{%- if min_value is not none %} and {{ expression | trim }} >{{ strict_operator }} {{ min_value }}{% endif %}\n{%- if max_value is not none %} and {{ expression | trim }} <{{ strict_operator }} {{ max_value }}{% endif %}\n)\n{% endset %}\n\n{{ dbt_expectations.expression_is_true(model,\n expression=expression_min_max,\n group_by_columns=group_by_columns,\n row_condition=row_condition)\n }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.964469, "supported_languages": null}, "macro.dbt_expectations.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.test_expression_is_true", "macro_sql": "{% test expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n\n {{ dbt_expectations.expression_is_true(model, expression, test_condition, group_by_columns, row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9653292, "supported_languages": null}, "macro.dbt_expectations.expression_is_true": {"name": "expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.expression_is_true", "macro_sql": "{% macro expression_is_true(model,\n expression,\n test_condition=\"= true\",\n group_by_columns=None,\n row_condition=None\n ) %}\n {{ adapter.dispatch('expression_is_true', 'dbt_expectations') (model, expression, test_condition, group_by_columns, row_condition) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9656882, "supported_languages": null}, "macro.dbt_expectations.default__expression_is_true": {"name": "default__expression_is_true", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/_generalized/expression_is_true.sql", "original_file_path": "macros/schema_tests/_generalized/expression_is_true.sql", "unique_id": "macro.dbt_expectations.default__expression_is_true", "macro_sql": "{% macro default__expression_is_true(model, expression, test_condition, group_by_columns, row_condition) -%}\nwith grouped_expression as (\n select\n {% if group_by_columns %}\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }} as col_{{ loop.index }},\n {% endfor -%}\n {% endif %}\n {{ dbt_expectations.truth_expression(expression) }}\n from {{ model }}\n {%- if row_condition %}\n where\n {{ row_condition }}\n {% endif %}\n {% if group_by_columns %}\n group by\n {% for group_by_column in group_by_columns -%}\n {{ group_by_column }}{% if not loop.last %},{% endif %}\n {% endfor %}\n {% endif %}\n\n),\nvalidation_errors as (\n\n select\n *\n from\n grouped_expression\n where\n not(expression {{ test_condition }})\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro -%}", "depends_on": {"macros": ["macro.dbt_expectations.truth_expression"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.966461, "supported_languages": null}, "macro.dbt_expectations.percentile_cont": {"name": "percentile_cont", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.percentile_cont", "macro_sql": "{% macro percentile_cont(field, quantile, partition=None) %}\n {{ adapter.dispatch('quantile', 'dbt_expectations') (field, quantile, partition) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__quantile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9670193, "supported_languages": null}, "macro.dbt_expectations.default__quantile": {"name": "default__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.default__quantile", "macro_sql": "{% macro default__quantile(field, quantile, partition) -%}\n percentile_cont({{ quantile }}) within group (order by {{ field }})\n {%- if partition %}over(partition by {{ partition }}){% endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9672484, "supported_languages": null}, "macro.dbt_expectations.bigquery__quantile": {"name": "bigquery__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.bigquery__quantile", "macro_sql": "{% macro bigquery__quantile(field, quantile, partition) -%}\n percentile_cont({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967459, "supported_languages": null}, "macro.dbt_expectations.spark__quantile": {"name": "spark__quantile", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/percentile_cont.sql", "original_file_path": "macros/math/percentile_cont.sql", "unique_id": "macro.dbt_expectations.spark__quantile", "macro_sql": "{% macro spark__quantile(field, quantile, partition) -%}\n percentile({{ field }}, {{ quantile }})\n over({%- if partition %}partition by {{ partition }}{% endif -%})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967666, "supported_languages": null}, "macro.dbt_expectations.log_natural": {"name": "log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.log_natural", "macro_sql": "{% macro log_natural(x) -%}\n {{ adapter.dispatch('log_natural', 'dbt_expectations') (x) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.967965, "supported_languages": null}, "macro.dbt_expectations.default__log_natural": {"name": "default__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.default__log_natural", "macro_sql": "{% macro default__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9680731, "supported_languages": null}, "macro.dbt_expectations.bigquery__log_natural": {"name": "bigquery__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.bigquery__log_natural", "macro_sql": "{% macro bigquery__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9681816, "supported_languages": null}, "macro.dbt_expectations.snowflake__log_natural": {"name": "snowflake__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.snowflake__log_natural", "macro_sql": "{% macro snowflake__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.968291, "supported_languages": null}, "macro.dbt_expectations.spark__log_natural": {"name": "spark__log_natural", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/log_natural.sql", "original_file_path": "macros/math/log_natural.sql", "unique_id": "macro.dbt_expectations.spark__log_natural", "macro_sql": "{% macro spark__log_natural(x) -%}\n\n ln({{ x }})\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.9684014, "supported_languages": null}, "macro.dbt_expectations.rand": {"name": "rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.rand", "macro_sql": "{% macro rand() -%}\n {{ adapter.dispatch('rand', 'dbt_expectations') () }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__rand"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449593.968701, "supported_languages": null}, "macro.dbt_expectations.default__rand": {"name": "default__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.default__rand", "macro_sql": "{% macro default__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0036144, "supported_languages": null}, "macro.dbt_expectations.bigquery__rand": {"name": "bigquery__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.bigquery__rand", "macro_sql": "{% macro bigquery__rand() -%}\n\n rand()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0037289, "supported_languages": null}, "macro.dbt_expectations.snowflake__rand": {"name": "snowflake__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.snowflake__rand", "macro_sql": "{% macro snowflake__rand(seed) -%}\n\n uniform(0::float, 1::float, random())\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0038218, "supported_languages": null}, "macro.dbt_expectations.postgres__rand": {"name": "postgres__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.postgres__rand", "macro_sql": "{% macro postgres__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0039022, "supported_languages": null}, "macro.dbt_expectations.redshift__rand": {"name": "redshift__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.redshift__rand", "macro_sql": "{% macro redshift__rand() -%}\n\n random()\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0039823, "supported_languages": null}, "macro.dbt_expectations.duckdb__rand": {"name": "duckdb__rand", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/rand.sql", "original_file_path": "macros/math/rand.sql", "unique_id": "macro.dbt_expectations.duckdb__rand", "macro_sql": "{% macro duckdb__rand() -%}\n\n random()\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0040598, "supported_languages": null}, "macro.dbt_expectations.median": {"name": "median", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/math/median.sql", "original_file_path": "macros/math/median.sql", "unique_id": "macro.dbt_expectations.median", "macro_sql": "{% macro median(field) %}\n{{ dbt_expectations.percentile_cont(field, 0.5) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.percentile_cont"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.004289, "supported_languages": null}, "macro.dbt_expectations.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_expectations')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0045583, "supported_languages": null}, "macro.dbt_expectations.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/groupby.sql", "original_file_path": "macros/utils/groupby.sql", "unique_id": "macro.dbt_expectations.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }}\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0048196, "supported_languages": null}, "macro.dbt_expectations.md5": {"name": "md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.md5", "macro_sql": "{%- macro md5(string_value) -%}\n {{ return(adapter.dispatch('md5', 'dbt_expectations')(string_value)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.default__md5"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0051165, "supported_languages": null}, "macro.dbt_expectations.default__md5": {"name": "default__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.default__md5", "macro_sql": "\n\n{%- macro default__md5(string_value) -%}\n\n {{ dbt.hash(string_value) }}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0052423, "supported_languages": null}, "macro.dbt_expectations.trino__md5": {"name": "trino__md5", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/md5.sql", "original_file_path": "macros/utils/md5.sql", "unique_id": "macro.dbt_expectations.trino__md5", "macro_sql": "{%- macro trino__md5(string_value) -%}\n\n md5(cast({{ string_value }} as varbinary))\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0053494, "supported_languages": null}, "macro.dbt_expectations.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_timestamp", "macro_sql": "\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt_expectations')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.00585, "supported_languages": null}, "macro.dbt_expectations.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0059462, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_timestamp": {"name": "snowflake__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_timestamp", "macro_sql": "{% macro snowflake__type_timestamp() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0060408, "supported_languages": null}, "macro.dbt_expectations.postgres__type_timestamp": {"name": "postgres__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_timestamp", "macro_sql": "{% macro postgres__type_timestamp() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0061338, "supported_languages": null}, "macro.dbt_expectations.trino__type_timestamp": {"name": "trino__type_timestamp", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_timestamp", "macro_sql": "{% macro trino__type_timestamp() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0062184, "supported_languages": null}, "macro.dbt_expectations.type_datetime": {"name": "type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.type_datetime", "macro_sql": "{% macro type_datetime() -%}\n {{ return(adapter.dispatch('type_datetime', 'dbt_expectations')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__type_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006382, "supported_languages": null}, "macro.dbt_expectations.default__type_datetime": {"name": "default__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.default__type_datetime", "macro_sql": "{% macro default__type_datetime() -%}\n datetime\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0064635, "supported_languages": null}, "macro.dbt_expectations.snowflake__type_datetime": {"name": "snowflake__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.snowflake__type_datetime", "macro_sql": "{% macro snowflake__type_datetime() -%}\n timestamp_ntz\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006549, "supported_languages": null}, "macro.dbt_expectations.postgres__type_datetime": {"name": "postgres__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.postgres__type_datetime", "macro_sql": "{% macro postgres__type_datetime() -%}\n timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006625, "supported_languages": null}, "macro.dbt_expectations.duckdb__type_datetime": {"name": "duckdb__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.duckdb__type_datetime", "macro_sql": "{% macro duckdb__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.006699, "supported_languages": null}, "macro.dbt_expectations.spark__type_datetime": {"name": "spark__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.spark__type_datetime", "macro_sql": "{% macro spark__type_datetime() -%}\n timestamp\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0067751, "supported_languages": null}, "macro.dbt_expectations.trino__type_datetime": {"name": "trino__type_datetime", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/utils/datatypes.sql", "original_file_path": "macros/utils/datatypes.sql", "unique_id": "macro.dbt_expectations.trino__type_datetime", "macro_sql": "{% macro trino__type_datetime() -%}\n timestamp(3)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0069246, "supported_languages": null}, "macro.dbt_expectations.regexp_instr": {"name": "regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.regexp_instr", "macro_sql": "{% macro regexp_instr(source_value, regexp, position=1, occurrence=1, is_raw=False, flags=\"\") %}\n\n {{ adapter.dispatch('regexp_instr', 'dbt_expectations')(\n source_value, regexp, position, occurrence, is_raw, flags\n ) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.duckdb__regexp_instr"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0083883, "supported_languages": null}, "macro.dbt_expectations.default__regexp_instr": {"name": "default__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.default__regexp_instr", "macro_sql": "{% macro default__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{# unclear if other databases support raw strings or flags #}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0087452, "supported_languages": null}, "macro.dbt_expectations.snowflake__regexp_instr": {"name": "snowflake__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.snowflake__regexp_instr", "macro_sql": "{% macro snowflake__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{%- set regexp = \"$$\" ~ regexp ~ \"$$\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'cimes') }}{% endif %}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0091963, "supported_languages": null}, "macro.dbt_expectations.bigquery__regexp_instr": {"name": "bigquery__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.bigquery__regexp_instr", "macro_sql": "{% macro bigquery__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# BigQuery prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n{% endif %}\n{%- set regexp = \"r'\" ~ regexp ~ \"'\" if is_raw else \"'\" ~ regexp ~ \"'\" -%}\nregexp_instr({{ source_value }}, {{ regexp }}, {{ position }}, {{ occurrence }})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0097046, "supported_languages": null}, "macro.dbt_expectations.postgres__regexp_instr": {"name": "postgres__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.postgres__regexp_instr", "macro_sql": "{% macro postgres__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'bcegimnpqstwx') }}{% endif %}\ncoalesce(array_length((select regexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')), 1), 0)\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0100322, "supported_languages": null}, "macro.dbt_expectations.redshift__regexp_instr": {"name": "redshift__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.redshift__regexp_instr", "macro_sql": "{% macro redshift__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_instr({{ source_value }}, '{{ regexp }}', {{ position }}, {{ occurrence }}, 0, '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0103803, "supported_languages": null}, "macro.dbt_expectations.duckdb__regexp_instr": {"name": "duckdb__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.duckdb__regexp_instr", "macro_sql": "{% macro duckdb__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if flags %}{{ dbt_expectations._validate_flags(flags, 'ciep') }}{% endif %}\nregexp_matches({{ source_value }}, '{{ regexp }}', '{{ flags }}')\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0106652, "supported_languages": null}, "macro.dbt_expectations.spark__regexp_instr": {"name": "spark__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.spark__regexp_instr", "macro_sql": "{% macro spark__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n{% if is_raw or flags %}\n {{ exceptions.warn(\n \"is_raw and flags options are not supported for this adapter \"\n ~ \"and are being ignored.\"\n ) }}\n{% endif %}\nlength(regexp_extract({{ source_value }}, '{{ regexp }}', 0))\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0109553, "supported_languages": null}, "macro.dbt_expectations.trino__regexp_instr": {"name": "trino__regexp_instr", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations.trino__regexp_instr", "macro_sql": "{% macro trino__regexp_instr(source_value, regexp, position, occurrence, is_raw, flags) %}\n {% if flags %}\n {{ dbt_expectations._validate_re2_flags(flags) }}\n {# Trino prepends \"(?flags)\" to set flags for current group #}\n {%- set regexp = \"(?\" ~ flags ~ \")\" ~ regexp -%}\n {% endif %}\n {% if is_raw %}\n {{ exceptions.warn(\n \"is_raw option is not supported for this adapter \"\n ~ \"and is being ignored.\"\n ) }}\n {% endif %}\n {%- set regexp_query = \"regexp_position(\" ~ source_value ~ \", '\" ~ regexp ~ \"', \" ~ position ~ \", \" ~ occurrence ~ \")\" -%}\n {# Trino regexp_position returns -1 if not found. Change it to 0, to be consistent with other adapters #}\n if({{ regexp_query}} = -1, 0, {{ regexp_query}})\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations._validate_re2_flags"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0115445, "supported_languages": null}, "macro.dbt_expectations._validate_flags": {"name": "_validate_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_flags", "macro_sql": "{% macro _validate_flags(flags, alphabet) %}\n{% for flag in flags %}\n {% if flag not in alphabet %}\n {# Using raise_compiler_error causes disabled tests with invalid flags to fail compilation #}\n {{ exceptions.warn(\n \"flag \" ~ flag ~ \" not in list of allowed flags for this adapter: \" ~ alphabet | join(\", \")\n ) }}\n {% endif %}\n{% endfor %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1723449594.0118933, "supported_languages": null}, "macro.dbt_expectations._validate_re2_flags": {"name": "_validate_re2_flags", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/regex/regexp_instr.sql", "original_file_path": "macros/regex/regexp_instr.sql", "unique_id": "macro.dbt_expectations._validate_re2_flags", "macro_sql": "{% macro _validate_re2_flags(flags) %}\n{# Re2 supports following flags: #}\n{# i : case-insensitive (default fault) #}\n{# m : multi-line mode: ^ and $ match begin/end line in addition to begin/end text (default false) #}\n{# s : let . match \\n (default false) #}\n{# U : ungreedy: swap meaning of x* and x*?, x+ and x+?, etc (default false) #}\n{# Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). #}\n\n{# Regex explanation: do not allow consecutive dashes, accept all re2 flags and clear operator, do not end with a dash #}\n{% set re2_flags_pattern = '^(?!.*--)[-imsU]*(? {{ threshold }}\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n{% endtest %}", "depends_on": {"macros": []}, "description": "Test that all numeric values in a column are below a specified threshold.", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": "dbt_bouncer_test_project://macros/_tests.yml", "arguments": [{"name": "model", "type": null, "description": "The model to test"}, {"name": "column_name", "type": null, "description": "The column to test"}, {"name": "threshold", "type": null, "description": "The threshold value"}], "created_at": 1724266024.824925, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2768002, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2783475, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2790623, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2800255, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2811193, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2822332, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2831764, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2841876, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2849853, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2864697, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1725012272.2886405, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_schema": {"name": "duckdb__create_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_schema", "macro_sql": "{% macro duckdb__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n {% set sql %}\n select type from duckdb_databases()\n where database_name='{{ relation.database }}'\n and type='sqlite'\n {% endset %}\n {% set results = run_query(sql) %}\n {% if results|length == 0 %}\n create schema if not exists {{ relation.without_identifier() }}\n {% else %}\n {% if relation.schema!='main' %}\n {{ exceptions.raise_compiler_error(\n \"Schema must be 'main' when writing to sqlite \"\n ~ \"instead got \" ~ relation.schema\n )}}\n {% endif %}\n {% endif %}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.394155, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_schema": {"name": "duckdb__drop_schema", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_schema", "macro_sql": "{% macro duckdb__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3949244, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_schemas": {"name": "duckdb__list_schemas", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_schemas", "macro_sql": "{% macro duckdb__list_schemas(database) -%}\n {% set sql %}\n select schema_name\n from system.information_schema.schemata\n {% if database is not none %}\n where catalog_name = '{{ database }}'\n {% endif %}\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3954024, "supported_languages": null}, "macro.dbt_duckdb.duckdb__check_schema_exists": {"name": "duckdb__check_schema_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__check_schema_exists", "macro_sql": "{% macro duckdb__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from system.information_schema.schemata\n where schema_name = '{{ schema }}'\n and catalog_name = '{{ information_schema.database }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.395774, "supported_languages": null}, "macro.dbt_duckdb.get_column_names": {"name": "get_column_names", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.get_column_names", "macro_sql": "{% macro get_column_names() %}\n {# loop through user_provided_columns to get column names #}\n {%- set user_provided_columns = model['columns'] -%}\n (\n {% for i in user_provided_columns %}\n {% set col = user_provided_columns[i] %}\n {{ col['name'] }} {{ \",\" if not loop.last }}\n {% endfor %}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3963099, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_table_as": {"name": "duckdb__create_table_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_table_as", "macro_sql": "{% macro duckdb__create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {%- if language == 'sql' -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(compiled_code) }}\n {% endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% if contract_config.enforced and not temporary %}\n {#-- DuckDB doesnt support constraints on temp tables --#}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} {{ get_column_names() }} (\n {{ get_select_subquery(compiled_code) }}\n );\n {% else %}\n as (\n {{ compiled_code }}\n );\n {% endif %}\n {%- elif language == 'python' -%}\n {{ py_write_table(temporary=temporary, relation=relation, compiled_code=compiled_code) }}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"duckdb__create_table_as macro didn't get supported language, it got %s\" % language) %}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt_duckdb.get_column_names", "macro.dbt.get_select_subquery", "macro.dbt_duckdb.py_write_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3978589, "supported_languages": null}, "macro.dbt_duckdb.py_write_table": {"name": "py_write_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.py_write_table", "macro_sql": "{% macro py_write_table(temporary, relation, compiled_code) -%}\n{{ compiled_code }}\n\ndef materialize(df, con):\n try:\n import pyarrow\n pyarrow_available = True\n except ImportError:\n pyarrow_available = False\n finally:\n if pyarrow_available and isinstance(df, pyarrow.Table):\n # https://github.com/duckdb/duckdb/issues/6584\n import pyarrow.dataset\n con.execute('create table {{ relation }} as select * from df')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3981087, "supported_languages": null}, "macro.dbt_duckdb.duckdb__create_view_as": {"name": "duckdb__create_view_as", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__create_view_as", "macro_sql": "{% macro duckdb__create_view_as(relation, sql) -%}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3987157, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_columns_in_relation": {"name": "duckdb__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_columns_in_relation", "macro_sql": "{% macro duckdb__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from system.information_schema.columns\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n {% if relation.database %}\n and table_catalog = '{{ relation.database }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.3994641, "supported_languages": null}, "macro.dbt_duckdb.duckdb__list_relations_without_caching": {"name": "duckdb__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__list_relations_without_caching", "macro_sql": "{% macro duckdb__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n table_name as name,\n table_schema as schema,\n CASE table_type\n WHEN 'BASE TABLE' THEN 'table'\n WHEN 'VIEW' THEN 'view'\n WHEN 'LOCAL TEMPORARY' THEN 'table'\n END as type\n from system.information_schema.tables\n where table_schema = '{{ schema_relation.schema }}'\n and table_catalog = '{{ schema_relation.database }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.39996, "supported_languages": null}, "macro.dbt_duckdb.duckdb__drop_relation": {"name": "duckdb__drop_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__drop_relation", "macro_sql": "{% macro duckdb__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4002833, "supported_languages": null}, "macro.dbt_duckdb.duckdb__rename_relation": {"name": "duckdb__rename_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__rename_relation", "macro_sql": "{% macro duckdb__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter {{ to_relation.type }} {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.400738, "supported_languages": null}, "macro.dbt_duckdb.duckdb__make_temp_relation": {"name": "duckdb__make_temp_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__make_temp_relation", "macro_sql": "{% macro duckdb__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix ~ py_current_timestring() %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.py_current_timestring"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.401311, "supported_languages": null}, "macro.dbt_duckdb.duckdb__current_timestamp": {"name": "duckdb__current_timestamp", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__current_timestamp", "macro_sql": "{% macro duckdb__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4014332, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_string_as_time": {"name": "duckdb__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_string_as_time", "macro_sql": "{% macro duckdb__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4016986, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_get_time": {"name": "duckdb__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro_sql": "{% macro duckdb__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4018571, "supported_languages": null}, "macro.dbt_duckdb.duckdb__get_incremental_default_sql": {"name": "duckdb__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.duckdb__get_incremental_default_sql", "macro_sql": "{% macro duckdb__get_incremental_default_sql(arg_dict) %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4020784, "supported_languages": null}, "macro.dbt_duckdb.location_exists": {"name": "location_exists", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.location_exists", "macro_sql": "{% macro location_exists(location) -%}\n {% do return(adapter.location_exists(location)) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4022996, "supported_languages": null}, "macro.dbt_duckdb.write_to_file": {"name": "write_to_file", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.write_to_file", "macro_sql": "{% macro write_to_file(relation, location, options) -%}\n {% call statement('write_to_file') -%}\n copy {{ relation }} to '{{ location }}' ({{ options }})\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4026256, "supported_languages": null}, "macro.dbt_duckdb.store_relation": {"name": "store_relation", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.store_relation", "macro_sql": "{% macro store_relation(plugin, relation, location, format, config) -%}\n {%- set column_list = adapter.get_columns_in_relation(relation) -%}\n {% do adapter.store_relation(plugin, relation, column_list, location, format, config) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4030533, "supported_languages": null}, "macro.dbt_duckdb.render_write_options": {"name": "render_write_options", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_duckdb.render_write_options", "macro_sql": "{% macro render_write_options(config) -%}\n {% set options = config.get('options', {}) %}\n {% if options is not mapping %}\n {% do exceptions.raise_compiler_error(\"The options argument must be a dictionary\") %}\n {% endif %}\n\n {% for k in options %}\n {% set _ = options.update({k: render(options[k])}) %}\n {% endfor %}\n\n {# legacy top-level write options #}\n {% if config.get('format') %}\n {% set _ = options.update({'format': render(config.get('format'))}) %}\n {% endif %}\n {% if config.get('delimiter') %}\n {% set _ = options.update({'delimiter': render(config.get('delimiter'))}) %}\n {% endif %}\n\n {% do return(options) %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4044728, "supported_languages": null}, "macro.dbt_duckdb.duckdb__snapshot_merge_sql": {"name": "duckdb__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__snapshot_merge_sql", "macro_sql": "{% macro duckdb__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }} as DBT_INTERNAL_TARGET\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = DBT_INTERNAL_TARGET.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and DBT_INTERNAL_TARGET.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4057293, "supported_languages": null}, "macro.dbt_duckdb.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(False, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4063513, "supported_languages": null}, "macro.dbt_duckdb.duckdb__post_snapshot": {"name": "duckdb__post_snapshot", "resource_type": "macro", "package_name": "dbt_duckdb", "path": "macros/snapshot_helper.sql", "original_file_path": "macros/snapshot_helper.sql", "unique_id": "macro.dbt_duckdb.duckdb__post_snapshot", "macro_sql": "{% macro duckdb__post_snapshot(staging_relation) %}\n {% do return(drop_relation(staging_relation)) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4065719, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4071171, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4077265, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4085588, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.408781, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4089947, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4091523, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_duckdb.duckdb__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4097521, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4099922, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4101048, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4103446, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt.default__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4110563, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4176369, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4180877, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4183512, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4185116, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4187484, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4189467, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4193237, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4197416, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where {{ columns.dbt_valid_to }} is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.421598, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4218664, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as {{ columns.dbt_valid_to }}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4225, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4231298, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.423987, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.424637, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.valid_snapshot_target(target_relation, columns) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.43159, "supported_languages": ["sql"]}, "macro.dbt.strategy_dispatch": {"name": "strategy_dispatch", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.strategy_dispatch", "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.435515, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.435766, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4360983, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4374356, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.437696, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.437965, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.439996, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes') or false %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4419692, "supported_languages": null}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4426734, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4433992, "supported_languages": null}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4446914, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.445039, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4453127, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4457414, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4460135, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4464412, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.446711, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4470913, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_duckdb.duckdb__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4473774, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4476044, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4478714, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4481091, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4485242, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4495187, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.451391, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4523482, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.453586, "supported_languages": null}, "macro.dbt_date.now": {"name": "now", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/now.sql", "original_file_path": "macros/calendar_date/now.sql", "unique_id": "macro.dbt_date.now", "macro_sql": "{%- macro now(tz=None) -%}\n{{ dbt_date.convert_timezone(dbt.current_timestamp(), tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.convert_timezone", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.453884, "supported_languages": null}, "macro.dbt_date.periods_since": {"name": "periods_since", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/periods_since.sql", "original_file_path": "macros/calendar_date/periods_since.sql", "unique_id": "macro.dbt_date.periods_since", "macro_sql": "{%- macro periods_since(date_col, period_name='day', tz=None) -%}\n{{ dbt.datediff(date_col, dbt_date.now(tz), period_name) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.454253, "supported_languages": null}, "macro.dbt_date.today": {"name": "today", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/today.sql", "original_file_path": "macros/calendar_date/today.sql", "unique_id": "macro.dbt_date.today", "macro_sql": "{%- macro today(tz=None) -%}\ncast({{ dbt_date.now(tz) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.now"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4545014, "supported_languages": null}, "macro.dbt_date.get_base_dates": {"name": "get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.get_base_dates", "macro_sql": "{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=\"day\") %}\n {{ adapter.dispatch('get_base_dates', 'dbt_date') (start_date, end_date, n_dateparts, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_base_dates"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4562974, "supported_languages": null}, "macro.dbt_date.default__get_base_dates": {"name": "default__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.default__get_base_dates", "macro_sql": "{% macro default__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4573998, "supported_languages": null}, "macro.dbt_date.bigquery__get_base_dates": {"name": "bigquery__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.bigquery__get_base_dates", "macro_sql": "{% macro bigquery__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as datetime )\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as datetime )\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.today()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt_date.today", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4584093, "supported_languages": null}, "macro.dbt_date.trino__get_base_dates": {"name": "trino__get_base_dates", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_base_dates.sql", "original_file_path": "macros/get_base_dates.sql", "unique_id": "macro.dbt_date.trino__get_base_dates", "macro_sql": "{% macro trino__get_base_dates(start_date, end_date, n_dateparts, datepart) %}\n\n{%- if start_date and end_date -%}\n{%- set start_date=\"cast('\" ~ start_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n{%- set end_date=\"cast('\" ~ end_date ~ \"' as \" ~ dbt.type_timestamp() ~ \")\" -%}\n\n{%- elif n_dateparts and datepart -%}\n\n{%- set start_date = dbt.dateadd(datepart, -1 * n_dateparts, dbt_date.now()) -%}\n{%- set end_date = dbt_date.tomorrow() -%}\n{%- endif -%}\n\nwith date_spine as\n(\n\n {{ dbt_date.date_spine(\n datepart=datepart,\n start_date=start_date,\n end_date=end_date,\n )\n }}\n\n)\nselect\n cast(d.date_{{ datepart }} as {{ dbt.type_timestamp() }}) as date_{{ datepart }}\nfrom\n date_spine d\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_date.tomorrow", "macro.dbt_date.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4595075, "supported_languages": null}, "macro.dbt_date.get_date_dimension": {"name": "get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.get_date_dimension", "macro_sql": "{% macro get_date_dimension(start_date, end_date) %}\n {{ adapter.dispatch('get_date_dimension', 'dbt_date') (start_date, end_date) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.default__get_date_dimension"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4678535, "supported_languages": null}, "macro.dbt_date.default__get_date_dimension": {"name": "default__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.default__get_date_dimension", "macro_sql": "{% macro default__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=false) }} as day_of_week,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week_iso,\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n cast({{ last_day('d.date_day', 'quarter') }} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4712567, "supported_languages": null}, "macro.dbt_date.postgres__get_date_dimension": {"name": "postgres__get_date_dimension", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/get_date_dimension.sql", "original_file_path": "macros/get_date_dimension.sql", "unique_id": "macro.dbt_date.postgres__get_date_dimension", "macro_sql": "{% macro postgres__get_date_dimension(start_date, end_date) %}\nwith base_dates as (\n {{ dbt_date.get_base_dates(start_date, end_date) }}\n),\ndates_with_prior_year_dates as (\n\n select\n cast(d.date_day as date) as date_day,\n cast({{ dbt.dateadd('year', -1 , 'd.date_day') }} as date) as prior_year_date_day,\n cast({{ dbt.dateadd('day', -364 , 'd.date_day') }} as date) as prior_year_over_year_date_day\n from\n \tbase_dates d\n\n)\nselect\n d.date_day,\n {{ dbt_date.yesterday('d.date_day') }} as prior_date_day,\n {{ dbt_date.tomorrow('d.date_day') }} as next_date_day,\n d.prior_year_date_day as prior_year_date_day,\n d.prior_year_over_year_date_day,\n {{ dbt_date.day_of_week('d.date_day', isoweek=true) }} as day_of_week,\n\n {{ dbt_date.day_name('d.date_day', short=false) }} as day_of_week_name,\n {{ dbt_date.day_name('d.date_day', short=true) }} as day_of_week_name_short,\n {{ dbt_date.day_of_month('d.date_day') }} as day_of_month,\n {{ dbt_date.day_of_year('d.date_day') }} as day_of_year,\n\n {{ dbt_date.week_start('d.date_day') }} as week_start_date,\n {{ dbt_date.week_end('d.date_day') }} as week_end_date,\n {{ dbt_date.week_start('d.prior_year_over_year_date_day') }} as prior_year_week_start_date,\n {{ dbt_date.week_end('d.prior_year_over_year_date_day') }} as prior_year_week_end_date,\n {{ dbt_date.week_of_year('d.date_day') }} as week_of_year,\n\n {{ dbt_date.iso_week_start('d.date_day') }} as iso_week_start_date,\n {{ dbt_date.iso_week_end('d.date_day') }} as iso_week_end_date,\n {{ dbt_date.iso_week_start('d.prior_year_over_year_date_day') }} as prior_year_iso_week_start_date,\n {{ dbt_date.iso_week_end('d.prior_year_over_year_date_day') }} as prior_year_iso_week_end_date,\n {{ dbt_date.iso_week_of_year('d.date_day') }} as iso_week_of_year,\n\n {{ dbt_date.week_of_year('d.prior_year_over_year_date_day') }} as prior_year_week_of_year,\n {{ dbt_date.iso_week_of_year('d.prior_year_over_year_date_day') }} as prior_year_iso_week_of_year,\n\n cast({{ dbt_date.date_part('month', 'd.date_day') }} as {{ dbt.type_int() }}) as month_of_year,\n {{ dbt_date.month_name('d.date_day', short=false) }} as month_name,\n {{ dbt_date.month_name('d.date_day', short=true) }} as month_name_short,\n\n cast({{ dbt.date_trunc('month', 'd.date_day') }} as date) as month_start_date,\n cast({{ last_day('d.date_day', 'month') }} as date) as month_end_date,\n\n cast({{ dbt.date_trunc('month', 'd.prior_year_date_day') }} as date) as prior_year_month_start_date,\n cast({{ last_day('d.prior_year_date_day', 'month') }} as date) as prior_year_month_end_date,\n\n cast({{ dbt_date.date_part('quarter', 'd.date_day') }} as {{ dbt.type_int() }}) as quarter_of_year,\n cast({{ dbt.date_trunc('quarter', 'd.date_day') }} as date) as quarter_start_date,\n {# last_day does not support quarter because postgresql does not support quarter interval. #}\n cast({{dbt.dateadd('day', '-1', dbt.dateadd('month', '3', dbt.date_trunc('quarter', 'd.date_day')))}} as date) as quarter_end_date,\n\n cast({{ dbt_date.date_part('year', 'd.date_day') }} as {{ dbt.type_int() }}) as year_number,\n cast({{ dbt.date_trunc('year', 'd.date_day') }} as date) as year_start_date,\n cast({{ last_day('d.date_day', 'year') }} as date) as year_end_date\nfrom\n dates_with_prior_year_dates d\norder by 1\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_date.get_base_dates", "macro.dbt.dateadd", "macro.dbt_date.yesterday", "macro.dbt_date.tomorrow", "macro.dbt_date.day_of_week", "macro.dbt_date.day_name", "macro.dbt_date.day_of_month", "macro.dbt_date.day_of_year", "macro.dbt_date.week_start", "macro.dbt_date.week_end", "macro.dbt_date.week_of_year", "macro.dbt_date.iso_week_start", "macro.dbt_date.iso_week_end", "macro.dbt_date.iso_week_of_year", "macro.dbt_date.date_part", "macro.dbt.type_int", "macro.dbt_date.month_name", "macro.dbt.date_trunc", "macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.474707, "supported_languages": null}, "macro.dbt_date.iso_week_end": {"name": "iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.iso_week_end", "macro_sql": "{%- macro iso_week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.default__iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4753418, "supported_languages": null}, "macro.dbt_date._iso_week_end": {"name": "_iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date._iso_week_end", "macro_sql": "{%- macro _iso_week_end(date, week_type) -%}\n{%- set dt = dbt_date.iso_week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.iso_week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4756503, "supported_languages": null}, "macro.dbt_date.default__iso_week_end": {"name": "default__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.default__iso_week_end", "macro_sql": "\n\n{%- macro default__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4758546, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_end": {"name": "snowflake__iso_week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_end.sql", "original_file_path": "macros/calendar_date/iso_week_end.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_end", "macro_sql": "\n\n{%- macro snowflake__iso_week_end(date) -%}\n{{ dbt_date._iso_week_end(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4760573, "supported_languages": null}, "macro.dbt_date.iso_week_of_year": {"name": "iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.iso_week_of_year", "macro_sql": "{%- macro iso_week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4769883, "supported_languages": null}, "macro.dbt_date._iso_week_of_year": {"name": "_iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date._iso_week_of_year", "macro_sql": "{%- macro _iso_week_of_year(date, week_type) -%}\ncast({{ dbt_date.date_part(week_type, date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4772637, "supported_languages": null}, "macro.dbt_date.default__iso_week_of_year": {"name": "default__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.default__iso_week_of_year", "macro_sql": "\n\n{%- macro default__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4774668, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_of_year": {"name": "snowflake__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_of_year", "macro_sql": "\n\n{%- macro snowflake__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'weekiso') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4776669, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_of_year": {"name": "postgres__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.postgres__iso_week_of_year", "macro_sql": "\n\n{%- macro postgres__iso_week_of_year(date) -%}\n-- postgresql week is isoweek, the first week of a year containing January 4 of that year.\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4778755, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_of_year": {"name": "duckdb__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_of_year", "macro_sql": "\n\n{%- macro duckdb__iso_week_of_year(date) -%}\n{{ return(dbt_date.postgres__iso_week_of_year(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4780793, "supported_languages": null}, "macro.dbt_date.spark__iso_week_of_year": {"name": "spark__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.spark__iso_week_of_year", "macro_sql": "\n\n{%- macro spark__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4782805, "supported_languages": null}, "macro.dbt_date.trino__iso_week_of_year": {"name": "trino__iso_week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_of_year.sql", "original_file_path": "macros/calendar_date/iso_week_of_year.sql", "unique_id": "macro.dbt_date.trino__iso_week_of_year", "macro_sql": "\n\n{%- macro trino__iso_week_of_year(date) -%}\n{{ dbt_date._iso_week_of_year(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4784832, "supported_languages": null}, "macro.dbt_date.iso_week_start": {"name": "iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.iso_week_start", "macro_sql": "{%- macro iso_week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('iso_week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4793513, "supported_languages": null}, "macro.dbt_date._iso_week_start": {"name": "_iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date._iso_week_start", "macro_sql": "{%- macro _iso_week_start(date, week_type) -%}\ncast({{ dbt.date_trunc(week_type, date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4795914, "supported_languages": null}, "macro.dbt_date.default__iso_week_start": {"name": "default__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.default__iso_week_start", "macro_sql": "\n\n{%- macro default__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'isoweek') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4798098, "supported_languages": null}, "macro.dbt_date.snowflake__iso_week_start": {"name": "snowflake__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.snowflake__iso_week_start", "macro_sql": "\n\n{%- macro snowflake__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4800253, "supported_languages": null}, "macro.dbt_date.postgres__iso_week_start": {"name": "postgres__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.postgres__iso_week_start", "macro_sql": "\n\n{%- macro postgres__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4802425, "supported_languages": null}, "macro.dbt_date.duckdb__iso_week_start": {"name": "duckdb__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.duckdb__iso_week_start", "macro_sql": "\n\n{%- macro duckdb__iso_week_start(date) -%}\n{{ return(dbt_date.postgres__iso_week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4804635, "supported_languages": null}, "macro.dbt_date.spark__iso_week_start": {"name": "spark__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.spark__iso_week_start", "macro_sql": "\n\n{%- macro spark__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4806652, "supported_languages": null}, "macro.dbt_date.trino__iso_week_start": {"name": "trino__iso_week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/iso_week_start.sql", "original_file_path": "macros/calendar_date/iso_week_start.sql", "unique_id": "macro.dbt_date.trino__iso_week_start", "macro_sql": "\n\n{%- macro trino__iso_week_start(date) -%}\n{{ dbt_date._iso_week_start(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date._iso_week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4808655, "supported_languages": null}, "macro.dbt_date.n_days_ago": {"name": "n_days_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_ago.sql", "original_file_path": "macros/calendar_date/n_days_ago.sql", "unique_id": "macro.dbt_date.n_days_ago", "macro_sql": "{%- macro n_days_ago(n, date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{%- set n = n|int -%}\ncast({{ dbt.dateadd('day', -1 * n, dt) }} as date)\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4815176, "supported_languages": null}, "macro.dbt_date.n_days_away": {"name": "n_days_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_days_away.sql", "original_file_path": "macros/calendar_date/n_days_away.sql", "unique_id": "macro.dbt_date.n_days_away", "macro_sql": "{%- macro n_days_away(n, date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(-1 * n, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4818614, "supported_languages": null}, "macro.dbt_date.week_end": {"name": "week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.week_end", "macro_sql": "{%- macro week_end(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_end', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.482529, "supported_languages": null}, "macro.dbt_date.default__week_end": {"name": "default__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.default__week_end", "macro_sql": "{%- macro default__week_end(date) -%}\n{{ last_day(date, 'week') }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4827323, "supported_languages": null}, "macro.dbt_date.snowflake__week_end": {"name": "snowflake__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.snowflake__week_end", "macro_sql": "\n\n{%- macro snowflake__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4830334, "supported_languages": null}, "macro.dbt_date.postgres__week_end": {"name": "postgres__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.postgres__week_end", "macro_sql": "\n\n{%- macro postgres__week_end(date) -%}\n{%- set dt = dbt_date.week_start(date) -%}\n{{ dbt_date.n_days_away(6, dt) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.week_start", "macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.483327, "supported_languages": null}, "macro.dbt_date.duckdb__week_end": {"name": "duckdb__week_end", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_end.sql", "original_file_path": "macros/calendar_date/week_end.sql", "unique_id": "macro.dbt_date.duckdb__week_end", "macro_sql": "\n\n{%- macro duckdb__week_end(date) -%}\n{{ return(dbt_date.postgres__week_end(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_end"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4835339, "supported_languages": null}, "macro.dbt_date.tomorrow": {"name": "tomorrow", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/tomorrow.sql", "original_file_path": "macros/calendar_date/tomorrow.sql", "unique_id": "macro.dbt_date.tomorrow", "macro_sql": "{%- macro tomorrow(date=None, tz=None) -%}\n{{ dbt_date.n_days_away(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4838355, "supported_languages": null}, "macro.dbt_date.yesterday": {"name": "yesterday", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/yesterday.sql", "original_file_path": "macros/calendar_date/yesterday.sql", "unique_id": "macro.dbt_date.yesterday", "macro_sql": "{%- macro yesterday(date=None, tz=None) -%}\n{{ dbt_date.n_days_ago(1, date, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_days_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4841328, "supported_languages": null}, "macro.dbt_date.n_months_ago": {"name": "n_months_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_ago.sql", "original_file_path": "macros/calendar_date/n_months_ago.sql", "unique_id": "macro.dbt_date.n_months_ago", "macro_sql": "{%- macro n_months_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4846423, "supported_languages": null}, "macro.dbt_date.last_month": {"name": "last_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month.sql", "original_file_path": "macros/calendar_date/last_month.sql", "unique_id": "macro.dbt_date.last_month", "macro_sql": "{%- macro last_month(tz=None) -%}\n{{ dbt_date.n_months_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.484896, "supported_languages": null}, "macro.dbt_date.last_month_name": {"name": "last_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_name.sql", "original_file_path": "macros/calendar_date/last_month_name.sql", "unique_id": "macro.dbt_date.last_month_name", "macro_sql": "{%- macro last_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.last_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4852304, "supported_languages": null}, "macro.dbt_date.last_month_number": {"name": "last_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_month_number.sql", "original_file_path": "macros/calendar_date/last_month_number.sql", "unique_id": "macro.dbt_date.last_month_number", "macro_sql": "{%- macro last_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.last_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.last_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.48553, "supported_languages": null}, "macro.dbt_date.n_months_away": {"name": "n_months_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_months_away.sql", "original_file_path": "macros/calendar_date/n_months_away.sql", "unique_id": "macro.dbt_date.n_months_away", "macro_sql": "{%- macro n_months_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('month',\n dbt.dateadd('month', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4860015, "supported_languages": null}, "macro.dbt_date.next_month": {"name": "next_month", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month.sql", "original_file_path": "macros/calendar_date/next_month.sql", "unique_id": "macro.dbt_date.next_month", "macro_sql": "{%- macro next_month(tz=None) -%}\n{{ dbt_date.n_months_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_months_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.486258, "supported_languages": null}, "macro.dbt_date.next_month_name": {"name": "next_month_name", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_name.sql", "original_file_path": "macros/calendar_date/next_month_name.sql", "unique_id": "macro.dbt_date.next_month_name", "macro_sql": "{%- macro next_month_name(short=True, tz=None) -%}\n{{ dbt_date.month_name(dbt_date.next_month(tz), short=short) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.month_name", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4865882, "supported_languages": null}, "macro.dbt_date.next_month_number": {"name": "next_month_number", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_month_number.sql", "original_file_path": "macros/calendar_date/next_month_number.sql", "unique_id": "macro.dbt_date.next_month_number", "macro_sql": "{%- macro next_month_number(tz=None) -%}\n{{ dbt_date.date_part('month', dbt_date.next_month(tz)) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt_date.next_month"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.486884, "supported_languages": null}, "macro.dbt_date.n_weeks_ago": {"name": "n_weeks_ago", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_ago.sql", "original_file_path": "macros/calendar_date/n_weeks_ago.sql", "unique_id": "macro.dbt_date.n_weeks_ago", "macro_sql": "{%- macro n_weeks_ago(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', -1 * n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4873843, "supported_languages": null}, "macro.dbt_date.last_week": {"name": "last_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/last_week.sql", "original_file_path": "macros/calendar_date/last_week.sql", "unique_id": "macro.dbt_date.last_week", "macro_sql": "{%- macro last_week(tz=None) -%}\n{{ dbt_date.n_weeks_ago(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_ago"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4876373, "supported_languages": null}, "macro.dbt_date.n_weeks_away": {"name": "n_weeks_away", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/n_weeks_away.sql", "original_file_path": "macros/calendar_date/n_weeks_away.sql", "unique_id": "macro.dbt_date.n_weeks_away", "macro_sql": "{%- macro n_weeks_away(n, tz=None) -%}\n{%- set n = n|int -%}\n{{ dbt.date_trunc('week',\n dbt.dateadd('week', n,\n dbt_date.today(tz)\n )\n ) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt.dateadd", "macro.dbt_date.today"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.488154, "supported_languages": null}, "macro.dbt_date.next_week": {"name": "next_week", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/next_week.sql", "original_file_path": "macros/calendar_date/next_week.sql", "unique_id": "macro.dbt_date.next_week", "macro_sql": "{%- macro next_week(tz=None) -%}\n{{ dbt_date.n_weeks_away(1, tz) }}\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_date.n_weeks_away"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4884355, "supported_languages": null}, "macro.dbt_date.week_of_year": {"name": "week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.week_of_year", "macro_sql": "{%- macro week_of_year(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_of_year', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_of_year"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4890475, "supported_languages": null}, "macro.dbt_date.default__week_of_year": {"name": "default__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.default__week_of_year", "macro_sql": "{%- macro default__week_of_year(date) -%}\ncast({{ dbt_date.date_part('week', date) }} as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.date_part", "macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.48939, "supported_languages": null}, "macro.dbt_date.postgres__week_of_year": {"name": "postgres__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.postgres__week_of_year", "macro_sql": "\n\n{%- macro postgres__week_of_year(date) -%}\n{# postgresql 'week' returns isoweek. Use to_char instead.\n WW = the first week starts on the first day of the year #}\ncast(to_char({{ date }}, 'WW') as {{ dbt.type_int() }})\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4896066, "supported_languages": null}, "macro.dbt_date.duckdb__week_of_year": {"name": "duckdb__week_of_year", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_of_year.sql", "original_file_path": "macros/calendar_date/week_of_year.sql", "unique_id": "macro.dbt_date.duckdb__week_of_year", "macro_sql": "\n\n{%- macro duckdb__week_of_year(date) -%}\ncast(ceil(dayofyear({{ date }}) / 7) as int)\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4897609, "supported_languages": null}, "macro.dbt_date.week_start": {"name": "week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.week_start", "macro_sql": "{%- macro week_start(date=None, tz=None) -%}\n{%-set dt = date if date else dbt_date.today(tz) -%}\n{{ adapter.dispatch('week_start', 'dbt_date') (dt) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_date.today", "macro.dbt_date.duckdb__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4904313, "supported_languages": null}, "macro.dbt_date.default__week_start": {"name": "default__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.default__week_start", "macro_sql": "{%- macro default__week_start(date) -%}\ncast({{ dbt.date_trunc('week', date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4906466, "supported_languages": null}, "macro.dbt_date.snowflake__week_start": {"name": "snowflake__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.snowflake__week_start", "macro_sql": "\n\n{%- macro snowflake__week_start(date) -%}\n {#\n Get the day of week offset: e.g. if the date is a Sunday,\n dbt_date.day_of_week returns 1, so we subtract 1 to get a 0 offset\n #}\n {% set off_set = dbt_date.day_of_week(date, isoweek=False) ~ \" - 1\" %}\n cast({{ dbt.dateadd(\"day\", \"-1 * (\" ~ off_set ~ \")\", date) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.day_of_week", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4910686, "supported_languages": null}, "macro.dbt_date.postgres__week_start": {"name": "postgres__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.postgres__week_start", "macro_sql": "\n\n{%- macro postgres__week_start(date) -%}\n-- Sunday as week start date\ncast({{ dbt.dateadd('day', -1, dbt.date_trunc('week', dbt.dateadd('day', 1, date))) }} as date)\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4914405, "supported_languages": null}, "macro.dbt_date.duckdb__week_start": {"name": "duckdb__week_start", "resource_type": "macro", "package_name": "dbt_date", "path": "macros/calendar_date/week_start.sql", "original_file_path": "macros/calendar_date/week_start.sql", "unique_id": "macro.dbt_date.duckdb__week_start", "macro_sql": "\n\n{%- macro duckdb__week_start(date) -%}\n{{ return(dbt_date.postgres__week_start(date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_date.postgres__week_start"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4916534, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart": {"name": "test_expect_row_values_to_have_data_for_every_n_datepart", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "original_file_path": "macros/schema_tests/distributional/expect_row_values_to_have_data_for_every_n_datepart.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_data_for_every_n_datepart", "macro_sql": "{%- test expect_row_values_to_have_data_for_every_n_datepart(model,\n date_col,\n date_part=\"day\",\n interval=None,\n row_condition=None,\n exclusion_condition=None,\n test_start_date=None,\n test_end_date=None) -%}\n{% if not execute %}\n {{ return('') }}\n{% endif %}\n\n{% if not test_start_date or not test_end_date %}\n {% set sql %}\n\n select\n min(cast({{ date_col }} as date)) as start_{{ date_part }},\n max(cast({{ date_col }} as date)) as end_{{ date_part }}\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n {% endset %}\n\n {%- set dr = run_query(sql) -%}\n\n {%- set db_start_date = dr.columns[0].values()[0] -%}\n {%- set db_end_date = dr.columns[1].values()[0] -%}\n\n {% if db_start_date is not string %}\n {%- set db_start_date = db_start_date.strftime('%Y-%m-%d') -%}\n {%- set db_end_date = db_end_date.strftime('%Y-%m-%d') -%}\n {% endif %}\n\n{% endif %}\n\n{% if not test_start_date %}\n{% set start_date = db_start_date %}\n{% else %}\n{% set start_date = test_start_date %}\n{% endif %}\n\n\n{% if not test_end_date %}\n{% set end_date = db_end_date %}\n{% else %}\n{% set end_date = test_end_date %}\n{% endif %}\n\nwith base_dates as (\n\n {{ dbt_date.get_base_dates(start_date=start_date, end_date=end_date, datepart=date_part) }}\n {% if interval %}\n {#\n Filter the date spine created above down to the interval granularity using a modulo operation.\n The number of date_parts after the start_date divided by the integer interval will produce no remainder for the desired intervals,\n e.g. for 2-day interval from a starting Jan 1, 2020:\n params: start_date = '2020-01-01', date_part = 'day', interval = 2\n date spine created above: [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-04, 2020-01-05, ...]\n The first parameter to the `mod` function would be the number of days between the start_date and the spine date, i.e. [0, 1, 2, 3, 4 ...]\n The second parameter to the `mod` function would be the integer interval, i.e. 2\n This modulo operation produces the following remainders: [0, 1, 0, 1, 0, ...]\n Filtering the spine only where this remainder == 0 will return a spine with every other day as desired, i.e. [2020-01-01, 2020-01-03, 2020-01-05, ...]\n #}\n where mod(\n cast({{ dbt.datediff(\"'\" ~ start_date ~ \"'\", 'date_' ~ date_part, date_part) }} as {{ dbt.type_int() }}),\n cast({{interval}} as {{ dbt.type_int() }})\n ) = 0\n {% endif %}\n\n),\nmodel_data as (\n\n select\n {% if not interval %}\n\n cast({{ dbt.date_trunc(date_part, date_col) }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n\n {% else %}\n {#\n Use a modulo operator to determine the number of intervals that a date_col is away from the interval-date spine\n and subtracts that amount to effectively slice each date_col record into its corresponding spine bucket,\n e.g. given a date_col of with records [2020-01-01, 2020-01-02, 2020-01-03, 2020-01-11, 2020-01-12]\n if we want to slice these dates into their 2-day buckets starting Jan 1, 2020 (start_date = '2020-01-01', date_part='day', interval=2),\n the modulo operation described above will produce these remainders: [0, 1, 0, 0, 1]\n subtracting that number of days from the observations will produce records [2020-01-01, 2020-01-01, 2020-01-03, 2020-01-11, 2020-01-11],\n all of which align with records from the interval-date spine\n #}\n {{ dbt.dateadd(\n date_part,\n \"mod(\n cast(\" ~ dbt.datediff(\"'\" ~ start_date ~ \"'\", date_col, date_part) ~ \" as \" ~ dbt.type_int() ~ \" ),\n cast(\" ~ interval ~ \" as \" ~ dbt.type_int() ~ \" )\n ) * (-1)\",\n \"cast( \" ~ dbt.date_trunc(date_part, date_col) ~ \" as \" ~ dbt_expectations.type_datetime() ~ \")\"\n )}} as date_{{ date_part }},\n\n {% endif %}\n\n count(*) as row_cnt\n from\n {{ model }} f\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n group by\n date_{{date_part}}\n\n),\n\nfinal as (\n\n select\n cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) as date_{{ date_part }},\n case when f.date_{{ date_part }} is null then true else false end as is_missing,\n coalesce(f.row_cnt, 0) as row_cnt\n from\n base_dates d\n left join\n model_data f on cast(d.date_{{ date_part }} as {{ dbt_expectations.type_datetime() }}) = f.date_{{ date_part }}\n)\nselect\n *\nfrom final\nwhere row_cnt = 0\n{% if exclusion_condition %}\n and {{ exclusion_condition }}\n{% endif %}\n{%- endtest -%}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt_date.get_base_dates", "macro.dbt.datediff", "macro.dbt.type_int", "macro.dbt.date_trunc", "macro.dbt_expectations.type_datetime", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.4973104, "supported_languages": null}, "macro.dbt_expectations._get_metric_expression": {"name": "_get_metric_expression", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations._get_metric_expression", "macro_sql": "{%- macro _get_metric_expression(metric_column, take_logs) -%}\n\n{%- if take_logs %}\n{%- set expr = \"nullif(\" ~ metric_column ~ \", 0)\" -%}\ncoalesce({{ dbt_expectations.log_natural(expr) }}, 0)\n{%- else -%}\ncoalesce({{ metric_column }}, 0)\n{%- endif %}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_expectations.log_natural"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5012617, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% test expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by=None,\n period='day',\n lookback_periods=1,\n trend_periods=7,\n test_periods=14,\n sigma_threshold=3,\n sigma_threshold_upper=None,\n sigma_threshold_lower=None,\n take_diffs=true,\n take_logs=true\n ) -%}\n {{ adapter.dispatch('test_expect_column_values_to_be_within_n_moving_stdevs', 'dbt_expectations') (model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) }}\n{%- endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5020745, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs": {"name": "default__test_expect_column_values_to_be_within_n_moving_stdevs", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "original_file_path": "macros/schema_tests/distributional/expect_column_values_to_be_within_n_moving_stdevs.sql", "unique_id": "macro.dbt_expectations.default__test_expect_column_values_to_be_within_n_moving_stdevs", "macro_sql": "{% macro default__test_expect_column_values_to_be_within_n_moving_stdevs(model,\n column_name,\n date_column_name,\n group_by,\n period,\n lookback_periods,\n trend_periods,\n test_periods,\n sigma_threshold,\n sigma_threshold_upper,\n sigma_threshold_lower,\n take_diffs,\n take_logs\n ) %}\n\n{%- set sigma_threshold_upper = sigma_threshold_upper if sigma_threshold_upper else sigma_threshold -%}\n{%- set sigma_threshold_lower = sigma_threshold_lower if sigma_threshold_lower else -1 * sigma_threshold -%}\n{%- set partition_by = \"partition by \" ~ (group_by | join(\",\")) if group_by -%}\n{%- set group_by_length = (group_by | length ) if group_by else 0 -%}\n\nwith metric_values as (\n\n with grouped_metric_values as (\n\n select\n {{ dbt.date_trunc(period, date_column_name) }} as metric_period,\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n sum({{ column_name }}) as agg_metric_value\n from\n {{ model }}\n {{ dbt_expectations.group_by(1 + group_by_length) }}\n\n )\n {%- if take_diffs %}\n , grouped_metric_values_with_priors as (\n\n select\n *,\n lag(agg_metric_value, {{ lookback_periods }}) over(\n {{ partition_by }}\n order by metric_period) as prior_agg_metric_value\n from\n grouped_metric_values d\n\n )\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n -\n {{ dbt_expectations._get_metric_expression(\"prior_agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values_with_priors d\n\n {%- else %}\n\n select\n *,\n {{ dbt_expectations._get_metric_expression(\"agg_metric_value\", take_logs) }}\n as metric_test_value\n from\n grouped_metric_values\n\n {%- endif %}\n\n),\nmetric_moving_calcs as (\n\n select\n *,\n avg(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_average,\n stddev(metric_test_value)\n over({{ partition_by }}\n order by metric_period rows\n between {{ trend_periods }} preceding and 1 preceding) as metric_test_rolling_stddev\n from\n metric_values\n\n),\nmetric_sigma as (\n\n select\n *,\n (metric_test_value - metric_test_rolling_average) as metric_test_delta,\n (metric_test_value - metric_test_rolling_average)/\n nullif(metric_test_rolling_stddev, 0) as metric_test_sigma\n from\n metric_moving_calcs\n\n)\nselect\n *\nfrom\n metric_sigma\nwhere\n\n metric_period >= cast(\n {{ dbt.dateadd(period, -test_periods, dbt.date_trunc(period, dbt_date.now())) }}\n as {{ dbt_expectations.type_timestamp() }})\n and\n metric_period < {{ dbt.date_trunc(period, dbt_date.now()) }}\n and\n\n not (\n metric_test_sigma >= {{ sigma_threshold_lower }} and\n metric_test_sigma <= {{ sigma_threshold_upper }}\n )\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.date_trunc", "macro.dbt_expectations.group_by", "macro.dbt_expectations._get_metric_expression", "macro.dbt.dateadd", "macro.dbt_date.now", "macro.dbt_expectations.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5042186, "supported_languages": null}, "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data": {"name": "test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% test expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_grouped_row_values_to_have_recent_data', 'dbt_expectations') (model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5065024, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data": {"name": "default__test_expect_grouped_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_grouped_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_grouped_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_grouped_row_values_to_have_recent_data(model,\n group_by,\n timestamp_column,\n datepart,\n interval,\n row_condition) %}\nwith latest_grouped_timestamps as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n max(cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }})) as latest_timestamp_column\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ timestamp_column }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n),\ntotal_row_counts as (\n\n select\n {{ group_by | join(\",\") ~ \",\" if group_by }}\n max(1) as join_key,\n count(*) as row_count\n from\n latest_grouped_timestamps\n {% if group_by -%}\n {{ dbt_expectations.group_by(group_by | length) }}\n {%- endif %}\n\n\n),\noutdated_grouped_timestamps as (\n\n select *\n from\n latest_grouped_timestamps\n where\n -- are the max timestamps per group older than the specified cutoff?\n latest_timestamp_column <\n cast(\n {{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }}\n as {{ dbt_expectations.type_timestamp() }}\n )\n\n),\nvalidation_errors as (\n\n select\n r.row_count,\n t.*\n from\n total_row_counts r\n left join\n outdated_grouped_timestamps t\n on\n {% for g in group_by %}\n r.{{ g }} = t.{{ g }} and\n {% endfor %}\n r.join_key = t.join_key\n where\n -- fail if either no rows were returned due to row_condition,\n -- or the recency test returned failed rows\n r.row_count = 0\n or\n t.join_key is not null\n\n)\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt_expectations.group_by", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5080137, "supported_languages": null}, "macro.dbt_expectations.test_expect_row_values_to_have_recent_data": {"name": "test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.test_expect_row_values_to_have_recent_data", "macro_sql": "{% test expect_row_values_to_have_recent_data(model,\n column_name,\n datepart,\n interval,\n row_condition=None) %}\n\n {{ adapter.dispatch('test_expect_row_values_to_have_recent_data', 'dbt_expectations') (model,\n column_name,\n datepart,\n interval,\n row_condition) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5091913, "supported_languages": null}, "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data": {"name": "default__test_expect_row_values_to_have_recent_data", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "original_file_path": "macros/schema_tests/table_shape/expect_row_values_to_have_recent_data.sql", "unique_id": "macro.dbt_expectations.default__test_expect_row_values_to_have_recent_data", "macro_sql": "{% macro default__test_expect_row_values_to_have_recent_data(model, column_name, datepart, interval, row_condition) %}\n{%- set default_start_date = '1970-01-01' -%}\nwith max_recency as (\n\n select max(cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }})) as max_timestamp\n from\n {{ model }}\n where\n -- to exclude erroneous future dates\n cast({{ column_name }} as {{ dbt_expectations.type_timestamp() }}) <= {{ dbt_date.now() }}\n {% if row_condition %}\n and {{ row_condition }}\n {% endif %}\n)\nselect\n *\nfrom\n max_recency\nwhere\n -- if the row_condition excludes all rows, we need to compare against a default date\n -- to avoid false negatives\n coalesce(max_timestamp, cast('{{ default_start_date }}' as {{ dbt_expectations.type_timestamp() }}))\n <\n cast({{ dbt.dateadd(datepart, interval * -1, dbt_date.now()) }} as {{ dbt_expectations.type_timestamp() }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_expectations.type_timestamp", "macro.dbt_date.now", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5100927, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_decreasing": {"name": "test_expect_column_values_to_be_decreasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_decreasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_decreasing", "macro_sql": "{% test expect_column_values_to_be_decreasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \"<\" if strictly else \"<=\" %}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field_lag - value_field) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5119727, "supported_languages": null}, "macro.dbt_expectations.test_expect_column_values_to_be_increasing": {"name": "test_expect_column_values_to_be_increasing", "resource_type": "macro", "package_name": "dbt_expectations", "path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "original_file_path": "macros/schema_tests/column_values_basic/expect_column_values_to_be_increasing.sql", "unique_id": "macro.dbt_expectations.test_expect_column_values_to_be_increasing", "macro_sql": "{% test expect_column_values_to_be_increasing(model, column_name,\n sort_column=None,\n strictly=True,\n row_condition=None,\n group_by=None,\n step=None) %}\n\n{%- set sort_column = column_name if not sort_column else sort_column -%}\n{%- set operator = \">\" if strictly else \">=\" -%}\nwith all_values as (\n\n select\n {{ sort_column }} as sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n {{ column_name }} as value_field\n from {{ model }}\n {% if row_condition %}\n where {{ row_condition }}\n {% endif %}\n\n),\nadd_lag_values as (\n\n select\n sort_column,\n {%- if group_by -%}\n {{ group_by | join(\", \") }},\n {%- endif %}\n value_field,\n lag(value_field) over\n {%- if not group_by -%}\n (order by sort_column)\n {%- else -%}\n (partition by {{ group_by | join(\", \") }} order by sort_column)\n {%- endif %} as value_field_lag\n from\n all_values\n\n),\nvalidation_errors as (\n select\n *\n from\n add_lag_values\n where\n value_field_lag is not null\n and\n not (\n (value_field {{ operator }} value_field_lag)\n {%- if step %}\n and ((value_field - value_field_lag) = {{ step }})\n {%- endif %}\n )\n\n)\nselect *\nfrom validation_errors\n{% endtest %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1727248393.5143006, "supported_languages": null}}, "docs": {"doc.dbt_bouncer_test_project.orders_status": {"name": "orders_status", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/docs.md", "original_file_path": "models/marts/finance/docs.md", "unique_id": "doc.dbt_bouncer_test_project.orders_status", "block_contents": "Orders can be one of the following statuses:\n\n| status | description |\n|----------------|------------------------------------------------------------------------------------------------------------------------|\n| placed | The order has been placed but has not yet left the warehouse |\n| shipped | The order has ben shipped to the customer and is currently in transit |\n| completed | The order has been received by the customer |\n| return_pending | The customer has indicated that they would like to return the order, but it has not yet been received at the warehouse |\n| returned | The order has been returned by the customer and received at the warehouse |"}, "doc.dbt_bouncer_test_project.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/overview.md", "original_file_path": "models/marts/finance/overview.md", "unique_id": "doc.dbt_bouncer_test_project.__overview__", "block_contents": "## Data Documentation for Jaffle Shop\n\n`jaffle_shop` is a fictional ecommerce store.\n\nThis [dbt](https://www.getdbt.com/) project is for testing out code.\n\nThe source code can be found [here](https://github.com/clrcrl/jaffle_shop)."}, "doc.dbt.__overview__": {"name": "__overview__", "resource_type": "doc", "package_name": "dbt", "path": "overview.md", "original_file_path": "docs/overview.md", "unique_id": "doc.dbt.__overview__", "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion"}, "doc.tiktok_ads_source.source_relation": {"name": "source_relation", "resource_type": "doc", "package_name": "tiktok_ads_source", "path": "docs.md", "original_file_path": "models/docs.md", "unique_id": "doc.tiktok_ads_source.source_relation", "block_contents": "The source of the record if the unioning functionality is being used. If not this field will be empty."}}, "exposures": {"exposure.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "exposure", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_exposures.yml", "original_file_path": "models/marts/finance/_exposures.yml", "unique_id": "exposure.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "type": "dashboard", "owner": {"email": "anna.anderson@example.com", "name": "Anna Anderson"}, "description": "", "label": null, "maturity": null, "meta": {}, "tags": [], "config": {"enabled": true}, "unrendered_config": {}, "url": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "sources": [], "metrics": [], "created_at": 1723450347.8033903}}, "metrics": {}, "groups": {}, "selectors": {"nodes_to_exclude": {"name": "nodes_to_exclude", "default": true, "definition": {"method": "package", "value": "dbt_bouncer_test_project"}}}, "disabled": {}, "parent_map": {"model.dbt_bouncer_test_project.stg_payments": ["seed.dbt_bouncer_test_project.raw_payments"], "model.dbt_bouncer_test_project.stg_orders": ["seed.dbt_bouncer_test_project.raw_orders"], "model.dbt_bouncer_test_project.int_model_1": [], "model.dbt_bouncer_test_project.orders": ["model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_orders": [], "seed.dbt_bouncer_test_project.raw_payments": [], "seed.dbt_bouncer_test_project.raw_customers": [], "model.tiktok_ads.tiktok_ads__ad_group_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__ad_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads.tiktok_ads__url_report": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_history", "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly", "model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads.tiktok_ads__campaign_report": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser", "model.tiktok_ads_source.stg_tiktok_ads__campaign_history", "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["source.tiktok_ads_source.tiktok_ads.adgroup_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["source.tiktok_ads_source.tiktok_ads.campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["source.tiktok_ads_source.tiktok_ads.advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["source.tiktok_ads_source.tiktok_ads.ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": ["model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": ["model.dbt_bouncer_test_project.stg_orders"], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": ["model.dbt_bouncer_test_project.int_model_1"], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": ["model.dbt_bouncer_test_project.orders"], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": ["model.dbt_bouncer_test_project.orders"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": ["model.tiktok_ads.tiktok_ads__advertiser_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": ["model.tiktok_ads.tiktok_ads__ad_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": ["model.tiktok_ads.tiktok_ads__ad_group_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": ["model.tiktok_ads.tiktok_ads__campaign_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": ["model.tiktok_ads.tiktok_ads__url_report"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.dbt_bouncer_test_project.stg_customers": ["seed.dbt_bouncer_test_project.raw_customers", "source.dbt_bouncer_test_project.dummy_source.customers"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": ["model.dbt_bouncer_test_project.stg_customers"], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": ["model.dbt_bouncer_test_project.stg_customers"], "model.dbt_bouncer_test_project.int_disabled_model": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": ["model.dbt_bouncer_test_project.int_disabled_model"], "model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.stg_customers", "model.dbt_bouncer_test_project.stg_orders", "model.dbt_bouncer_test_project.stg_payments"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": ["model.dbt_bouncer_test_project.customers"], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": ["model.dbt_bouncer_test_project.customers"], "model.dbt_bouncer_test_project.metricflow_time_spine": [], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": ["model.dbt_bouncer_test_project.metricflow_time_spine"], "snapshot.dbt_bouncer_test_project.orders_snapshot": ["seed.dbt_bouncer_test_project.raw_orders"], "source.tiktok_ads_source.tiktok_ads.advertiser": [], "source.tiktok_ads_source.tiktok_ads.campaign_history": [], "source.tiktok_ads_source.tiktok_ads.adgroup_history": [], "source.tiktok_ads_source.tiktok_ads.ad_history": [], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": [], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": [], "source.dbt_bouncer_test_project.dummy_source.customers": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "semantic_model.dbt_bouncer_test_project.customers": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": ["model.dbt_bouncer_test_project.customers"], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": ["model.dbt_bouncer_test_project.orders"]}, "child_map": {"model.dbt_bouncer_test_project.stg_payments": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712"], "model.dbt_bouncer_test_project.stg_orders": ["model.dbt_bouncer_test_project.customers", "model.dbt_bouncer_test_project.orders", "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a"], "model.dbt_bouncer_test_project.int_model_1": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d"], "model.dbt_bouncer_test_project.orders": ["test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "unit_test.dbt_bouncer_test_project.orders.test_amount_logic"], "seed.dbt_bouncer_test_project.raw_orders": ["model.dbt_bouncer_test_project.stg_orders", "snapshot.dbt_bouncer_test_project.orders_snapshot"], "seed.dbt_bouncer_test_project.raw_payments": ["model.dbt_bouncer_test_project.stg_payments"], "seed.dbt_bouncer_test_project.raw_customers": ["model.dbt_bouncer_test_project.stg_customers"], "model.tiktok_ads.tiktok_ads__ad_group_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4", "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e"], "model.tiktok_ads.tiktok_ads__ad_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a", "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707", "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed"], "model.tiktok_ads.tiktok_ads__advertiser_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce", "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99"], "model.tiktok_ads.tiktok_ads__url_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3", "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0", "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b", "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff"], "model.tiktok_ads.tiktok_ads__campaign_report": ["test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8", "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly": ["model.tiktok_ads.tiktok_ads__campaign_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036", "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser": ["model.tiktok_ads.tiktok_ads__ad_group_report", "model.tiktok_ads.tiktok_ads__ad_report", "model.tiktok_ads.tiktok_ads__advertiser_report", "model.tiktok_ads.tiktok_ads__campaign_report", "model.tiktok_ads.tiktok_ads__url_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8", "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly": ["model.tiktok_ads.tiktok_ads__ad_group_report", "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1", "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127"], "model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly"], "model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history"], "model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history"], "model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser"], "model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history"], "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712": [], "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075": [], "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a": [], "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64": [], "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d": [], "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3": [], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12": [], "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e": [], "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed": [], "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af": [], "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2": [], "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3": [], "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd": [], "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59": [], "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625": [], "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49": [], "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_date_day.1276998c99": [], "test.tiktok_ads.not_null_tiktok_ads__advertiser_report_advertiser_id.f956c568ce": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__advertiser_report_source_relation__advertiser_id__date_day.1797053b3d": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_date_day.d61ee4a5ed": [], "test.tiktok_ads.not_null_tiktok_ads__ad_report_ad_id.2d8166e707": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.c260f4392a": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_date_day.e39164964e": [], "test.tiktok_ads.not_null_tiktok_ads__ad_group_report_ad_group_id.17fb8710f4": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__ad_group_report_source_relation__ad_group_id__campaign_id__advertiser_id__date_day.e3850c1634": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_date_day.3807b0e836": [], "test.tiktok_ads.not_null_tiktok_ads__campaign_report_campaign_id.8a2b0c8ef8": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__campaign_report_source_relation__campaign_id__advertiser_id__date_day.98200e9b0f": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_date_day.d593573eff": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_ad_id.6c41067bd0": [], "test.tiktok_ads.not_null_tiktok_ads__url_report_base_url.37afef2e1b": [], "test.tiktok_ads.dbt_utils_unique_combination_of_columns_tiktok_ads__url_report_source_relation__ad_id__ad_group_id__campaign_id__advertiser_id__date_day.98153764a3": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__advertiser_advertiser_id.5deab92def": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__advertiser_source_relation__advertiser_id.4b39eb0db8": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_history_ad_group_id.04778d7fad": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_history_source_relation__ad_group_id__updated_at.94fc2240d4": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_history_ad_id.4ffd05b23a": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_history_source_relation__ad_id__updated_at.64ebc5aea6": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_history_campaign_id.7f9147d1e1": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_history_source_relation__campaign_id__updated_at.52babc6036": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_ad_id.ee84d783ed": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_report_hourly_stat_time_hour.9e2a2dca81": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_report_hourly_source_relation__ad_id__stat_time_hour.1f7d670427": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_ad_group_id.8da17119f1": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__ad_group_report_hourly_stat_time_hour.ca4b495127": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__ad_group_report_hourly_source_relation__ad_group_id__stat_time_hour.f0681f097c": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_campaign_id.ef898379fb": [], "test.tiktok_ads_source.not_null_stg_tiktok_ads__campaign_report_hourly_stat_time_hour.e75e13184c": [], "test.tiktok_ads_source.dbt_utils_unique_combination_of_columns_stg_tiktok_ads__campaign_report_hourly_source_relation__campaign_id__stat_time_hour.91b84f3ede": [], "model.dbt_bouncer_test_project.stg_customers": ["model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada"], "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada": [], "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "model.dbt_bouncer_test_project.int_disabled_model": ["test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e"], "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e": [], "model.dbt_bouncer_test_project.customers": ["exposure.dbt_bouncer_test_project.customers", "semantic_model.dbt_bouncer_test_project.customers", "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "unit_test.dbt_bouncer_test_project.customers.test_clv_logic"], "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1": [], "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d": [], "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b": [], "model.dbt_bouncer_test_project.metricflow_time_spine": ["test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8"], "test.dbt_bouncer_test_project.test_assert_something": [], "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d": [], "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8": [], "snapshot.dbt_bouncer_test_project.orders_snapshot": [], "source.tiktok_ads_source.tiktok_ads.advertiser": ["model.tiktok_ads_source.stg_tiktok_ads__advertiser_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_history": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_history_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_history": ["model.tiktok_ads_source.stg_tiktok_ads__ad_history_tmp"], "source.tiktok_ads_source.tiktok_ads.ad_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.campaign_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__campaign_report_hourly_tmp"], "source.tiktok_ads_source.tiktok_ads.adgroup_report_hourly": ["model.tiktok_ads_source.stg_tiktok_ads__ad_group_report_hourly_tmp"], "source.dbt_bouncer_test_project.dummy_source.customers": ["model.dbt_bouncer_test_project.stg_customers"], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_1": [], "source.dbt_bouncer_test_project.sources_that_dont_really_exist.source_2": [], "exposure.dbt_bouncer_test_project.customers": [], "semantic_model.dbt_bouncer_test_project.customers": [], "unit_test.dbt_bouncer_test_project.customers.test_clv_logic": [], "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {"semantic_model.dbt_bouncer_test_project.customers": {"name": "customers", "resource_type": "semantic_model", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_semantic_models.yml", "original_file_path": "models/marts/finance/_semantic_models.yml", "unique_id": "semantic_model.dbt_bouncer_test_project.customers", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers"], "model": "ref('customers')", "node_relation": {"alias": "customers", "schema_name": "main", "database": "dbt", "relation_name": "\"dbt\".\"main\".\"customers\""}, "description": "same as always", "label": null, "defaults": {"agg_time_dimension": "first_order_date"}, "entities": [{"name": "customer", "type": "primary", "description": null, "label": null, "role": null, "expr": "customer_id"}], "measures": [{"name": "customer_lifetime_value", "agg": "sum", "description": "The total value of the customer.", "label": null, "create_metric": false, "expr": null, "agg_params": null, "non_additive_dimension": null, "agg_time_dimension": null}], "dimensions": [{"name": "first_order_date", "type": "time", "description": null, "label": null, "is_partition": false, "type_params": {"time_granularity": "day", "validity_params": null}, "expr": null, "metadata": null}], "metadata": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "refs": [{"name": "customers", "package": null, "version": null}], "created_at": 1725012272.4653726, "config": {"enabled": true, "group": null, "meta": {}}, "unrendered_config": {}, "primary_entity": null, "group": null}}, "unit_tests": {"unit_test.dbt_bouncer_test_project.customers.test_clv_logic": {"model": "customers", "given": [{"input": "ref('stg_customers')", "rows": "select 1 as customer_id, 'Anna' as first_name, 'Anderson' as last_name union all select 2 as customer_id, 'Bob' as first_name, 'Bobbington' as last_name union all select 3 as customer_id, 'Chrissi' as first_name, 'Christensen' as last_name", "format": "sql", "fixture": null}, {"input": "ref('stg_orders')", "rows": [{"customer_id": 1, "order_date": "2022-01-01", "order_id": 1}, {"customer_id": 1, "order_date": "2022-01-02", "order_id": 2}, {"customer_id": 2, "order_date": "2022-01-02", "order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"order_id": "1", "amount": "100"}, {"order_id": "2", "amount": "50"}, {"order_id": "3", "amount": "25"}], "format": "csv", "fixture": "stg_payments"}], "expect": {"rows": [{"customer_id": 1, "customer_lifetime_value": 150}, {"customer_id": 2, "customer_lifetime_value": 25}, {"customer_id": 3, "customer_lifetime_value": 0}], "format": "dict", "fixture": null}, "name": "test_clv_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.customers.test_clv_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "customers", "test_clv_logic"], "description": "Validate CLV logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.customers"]}, "config": {"tags": [], "meta": {}}, "checksum": "c42689c77eb9cdd188cb7664846e92985c7d1a130fb02d8f88070d88a047aad2", "schema": "main", "created_at": 1724580241.8318431, "versions": null, "version": null}, "unit_test.dbt_bouncer_test_project.orders.test_amount_logic": {"model": "orders", "given": [{"input": "ref('stg_orders')", "rows": [{"order_id": 1}, {"order_id": 2}, {"order_id": 3}], "format": "dict", "fixture": null}, {"input": "ref('stg_payments')", "rows": [{"amount": 10, "order_id": 1, "payment_method": "credit_card"}, {"amount": 20, "order_id": 2, "payment_method": "credit_card"}, {"amount": 30, "order_id": 3, "payment_method": "coupon"}], "format": "dict", "fixture": null}], "expect": {"rows": [{"amount": 10, "order_id": 1, "coupon_amount": 0, "credit_card_amount": 10}, {"amount": 20, "order_id": 2, "coupon_amount": 0, "credit_card_amount": 20}, {"amount": 30, "order_id": 3, "coupon_amount": 30, "credit_card_amount": 0}], "format": "dict", "fixture": null}, "name": "test_amount_logic", "resource_type": "unit_test", "package_name": "dbt_bouncer_test_project", "path": "marts/finance/_finance_unit_tests.yml", "original_file_path": "models/marts/finance/_finance_unit_tests.yml", "unique_id": "unit_test.dbt_bouncer_test_project.orders.test_amount_logic", "fqn": ["dbt_bouncer_test_project", "marts", "finance", "orders", "test_amount_logic"], "description": "Validate amount logic", "overrides": null, "depends_on": {"macros": [], "nodes": ["model.dbt_bouncer_test_project.orders"]}, "config": {"tags": [], "meta": {}}, "checksum": "5b656bfcdd083e4af89f4c506f86484bd9ca1894e07b20a4f8a8f33aaf8a0849", "schema": "main", "created_at": 1724601893.3793342, "versions": null, "version": null}}} diff --git a/tests/fixtures/dbt_18/target/run_results.json b/tests/fixtures/dbt_18/target/run_results.json index fab7cbb..4b4a421 100644 --- a/tests/fixtures/dbt_18/target/run_results.json +++ b/tests/fixtures/dbt_18/target/run_results.json @@ -1 +1 @@ -{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T07:13:19.542700Z", "invocation_id": "78e56a75-e61f-4b5d-8dc4-e1d066acd90a", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.543037Z", "completed_at": "2024-09-25T07:13:18.555354Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.584315Z", "completed_at": "2024-09-25T07:13:18.584343Z"}], "thread_id": "Thread-4", "execution_time": 0.08050537109375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.548531Z", "completed_at": "2024-09-25T07:13:18.558282Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.586505Z", "completed_at": "2024-09-25T07:13:18.586538Z"}], "thread_id": "Thread-5", "execution_time": 0.0809323787689209, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.560445Z", "completed_at": "2024-09-25T07:13:18.566596Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.588862Z", "completed_at": "2024-09-25T07:13:18.588885Z"}], "thread_id": "Thread-6", "execution_time": 0.07961797714233398, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.525344Z", "completed_at": "2024-09-25T07:13:18.582755Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.593956Z", "completed_at": "2024-09-25T07:13:18.593979Z"}], "thread_id": "Thread-3", "execution_time": 0.09244990348815918, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.568679Z", "completed_at": "2024-09-25T07:13:18.601479Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.645032Z", "completed_at": "2024-09-25T07:13:18.645071Z"}], "thread_id": "Thread-7", "execution_time": 0.13482451438903809, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.603988Z", "completed_at": "2024-09-25T07:13:18.734990Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.781410Z", "completed_at": "2024-09-25T07:13:18.781446Z"}], "thread_id": "Thread-8", "execution_time": 0.20098137855529785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.692109Z", "completed_at": "2024-09-25T07:13:18.794445Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.806936Z", "completed_at": "2024-09-25T07:13:18.806965Z"}], "thread_id": "Thread-1", "execution_time": 0.18485236167907715, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.783969Z", "completed_at": "2024-09-25T07:13:18.793438Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.810820Z", "completed_at": "2024-09-25T07:13:18.810851Z"}], "thread_id": "Thread-6", "execution_time": 0.12958979606628418, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n\n\nselect * from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"snapshots\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.686859Z", "completed_at": "2024-09-25T07:13:18.798631Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.823494Z", "completed_at": "2024-09-25T07:13:18.823519Z"}], "thread_id": "Thread-4", "execution_time": 0.2122352123260498, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.736595Z", "completed_at": "2024-09-25T07:13:18.803353Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.830598Z", "completed_at": "2024-09-25T07:13:18.830629Z"}], "thread_id": "Thread-5", "execution_time": 0.1962738037109375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.771700Z", "completed_at": "2024-09-25T07:13:18.804959Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.832897Z", "completed_at": "2024-09-25T07:13:18.832924Z"}], "thread_id": "Thread-2", "execution_time": 0.15517497062683105, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.761454Z", "completed_at": "2024-09-25T07:13:18.809134Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.836961Z", "completed_at": "2024-09-25T07:13:18.836991Z"}], "thread_id": "Thread-3", "execution_time": 0.18183183670043945, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.813067Z", "completed_at": "2024-09-25T07:13:18.842822Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.867125Z", "completed_at": "2024-09-25T07:13:18.867163Z"}], "thread_id": "Thread-7", "execution_time": 0.11004161834716797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.856347Z", "completed_at": "2024-09-25T07:13:18.892461Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.907525Z", "completed_at": "2024-09-25T07:13:18.907533Z"}], "thread_id": "Thread-8", "execution_time": 0.0787956714630127, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.883325Z", "completed_at": "2024-09-25T07:13:18.930463Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:18.964926Z", "completed_at": "2024-09-25T07:13:18.964962Z"}], "thread_id": "Thread-1", "execution_time": 0.11885404586791992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.897616Z", "completed_at": "2024-09-25T07:13:18.961438Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.095939Z", "completed_at": "2024-09-25T07:13:19.095983Z"}], "thread_id": "Thread-6", "execution_time": 0.2210216522216797, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.908390Z", "completed_at": "2024-09-25T07:13:18.963271Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.101970Z", "completed_at": "2024-09-25T07:13:19.102002Z"}], "thread_id": "Thread-4", "execution_time": 0.2250528335571289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.918763Z", "completed_at": "2024-09-25T07:13:18.967202Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.107208Z", "completed_at": "2024-09-25T07:13:19.107239Z"}], "thread_id": "Thread-3", "execution_time": 0.22889947891235352, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.932116Z", "completed_at": "2024-09-25T07:13:18.969002Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.110192Z", "completed_at": "2024-09-25T07:13:19.110227Z"}], "thread_id": "Thread-2", "execution_time": 0.23119425773620605, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.937478Z", "completed_at": "2024-09-25T07:13:19.099852Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.117399Z", "completed_at": "2024-09-25T07:13:19.117428Z"}], "thread_id": "Thread-5", "execution_time": 0.2363903522491455, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:18.970593Z", "completed_at": "2024-09-25T07:13:19.120176Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.143901Z", "completed_at": "2024-09-25T07:13:19.143927Z"}], "thread_id": "Thread-7", "execution_time": 0.2478933334350586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.127069Z", "completed_at": "2024-09-25T07:13:19.152427Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.196037Z", "completed_at": "2024-09-25T07:13:19.196071Z"}], "thread_id": "Thread-8", "execution_time": 0.10365772247314453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.169949Z", "completed_at": "2024-09-25T07:13:19.216978Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.232410Z", "completed_at": "2024-09-25T07:13:19.232446Z"}], "thread_id": "Thread-6", "execution_time": 0.09098434448242188, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.159487Z", "completed_at": "2024-09-25T07:13:19.219451Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.234842Z", "completed_at": "2024-09-25T07:13:19.234877Z"}], "thread_id": "Thread-1", "execution_time": 0.11084389686584473, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.198568Z", "completed_at": "2024-09-25T07:13:19.227423Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.261518Z", "completed_at": "2024-09-25T07:13:19.261550Z"}], "thread_id": "Thread-4", "execution_time": 0.11529016494750977, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.237293Z", "completed_at": "2024-09-25T07:13:19.289104Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.315040Z", "completed_at": "2024-09-25T07:13:19.315068Z"}], "thread_id": "Thread-3", "execution_time": 0.10638904571533203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.251050Z", "completed_at": "2024-09-25T07:13:19.294482Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.330813Z", "completed_at": "2024-09-25T07:13:19.330850Z"}], "thread_id": "Thread-2", "execution_time": 0.11848711967468262, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.267150Z", "completed_at": "2024-09-25T07:13:19.296518Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.333208Z", "completed_at": "2024-09-25T07:13:19.333239Z"}], "thread_id": "Thread-5", "execution_time": 0.11877655982971191, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.317428Z", "completed_at": "2024-09-25T07:13:19.352426Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.386380Z", "completed_at": "2024-09-25T07:13:19.386412Z"}], "thread_id": "Thread-8", "execution_time": 0.12123441696166992, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.299823Z", "completed_at": "2024-09-25T07:13:19.358333Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.395201Z", "completed_at": "2024-09-25T07:13:19.395226Z"}], "thread_id": "Thread-7", "execution_time": 0.14775776863098145, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.340954Z", "completed_at": "2024-09-25T07:13:19.400059Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.416770Z", "completed_at": "2024-09-25T07:13:19.416811Z"}], "thread_id": "Thread-6", "execution_time": 0.1244959831237793, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.372451Z", "completed_at": "2024-09-25T07:13:19.406956Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.434513Z", "completed_at": "2024-09-25T07:13:19.434540Z"}], "thread_id": "Thread-4", "execution_time": 0.12452578544616699, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.362063Z", "completed_at": "2024-09-25T07:13:19.414972Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.461661Z", "completed_at": "2024-09-25T07:13:19.461692Z"}], "thread_id": "Thread-1", "execution_time": 0.16392302513122559, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.419305Z", "completed_at": "2024-09-25T07:13:19.473367Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.505646Z", "completed_at": "2024-09-25T07:13:19.505680Z"}], "thread_id": "Thread-3", "execution_time": 0.1232156753540039, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.437046Z", "completed_at": "2024-09-25T07:13:19.475424Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.515444Z", "completed_at": "2024-09-25T07:13:19.515468Z"}], "thread_id": "Thread-2", "execution_time": 0.12254524230957031, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.451073Z", "completed_at": "2024-09-25T07:13:19.493501Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.517790Z", "completed_at": "2024-09-25T07:13:19.517823Z"}], "thread_id": "Thread-5", "execution_time": 0.12037038803100586, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.495121Z", "completed_at": "2024-09-25T07:13:19.521434Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.523967Z", "completed_at": "2024-09-25T07:13:19.523992Z"}], "thread_id": "Thread-7", "execution_time": 0.08184576034545898, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T07:13:19.477396Z", "completed_at": "2024-09-25T07:13:19.526531Z"}, {"name": "execute", "started_at": "2024-09-25T07:13:19.528221Z", "completed_at": "2024-09-25T07:13:19.528245Z"}], "thread_id": "Thread-8", "execution_time": 0.10401558876037598, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}], "elapsed_time": 1.2675178050994873, "args": {"show_resource_report": false, "warn_error_options": {"include": [], "exclude": []}, "enable_legacy_logger": false, "quiet": false, "log_file_max_bytes": 10485760, "send_anonymous_usage_stats": true, "static": false, "use_colors_file": true, "defer": false, "populate_cache": true, "profiles_dir": "dbt_project", "project_dir": "dbt_project", "select": [], "vars": {}, "write_json": true, "require_resource_names_without_spaces": false, "partial_parse": true, "log_format": "default", "version_check": true, "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target", "print": true, "require_explicit_package_overrides_for_builtin_materializations": true, "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target", "compile": true, "introspect": true, "log_path": "dbt_project/logs", "use_colors": true, "favor_state": false, "log_level": "info", "exclude": [], "partial_parse_file_diff": true, "static_parser": true, "source_freshness_run_project_hooks": false, "empty_catalog": false, "log_format_file": "debug", "log_level_file": "debug", "which": "generate", "printer_width": 80, "indirect_selection": "eager", "strict_mode": false, "macro_debugging": false, "cache_selected_only": false}} +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v6.json", "dbt_version": "1.8.0", "generated_at": "2024-09-25T09:40:53.322315Z", "invocation_id": "d58710f9-9cc9-4f55-824b-aa1c85ec8b54", "env": {}}, "results": [{"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.343632Z", "completed_at": "2024-09-25T09:40:52.347139Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.360310Z", "completed_at": "2024-09-25T09:40:52.360324Z"}], "thread_id": "Thread-4", "execution_time": 0.03829336166381836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_customers", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.350270Z", "completed_at": "2024-09-25T09:40:52.352768Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.364112Z", "completed_at": "2024-09-25T09:40:52.364125Z"}], "thread_id": "Thread-5", "execution_time": 0.04037618637084961, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_orders", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.353508Z", "completed_at": "2024-09-25T09:40:52.355729Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.365316Z", "completed_at": "2024-09-25T09:40:52.365329Z"}], "thread_id": "Thread-6", "execution_time": 0.03997063636779785, "adapter_response": {}, "message": null, "failures": null, "unique_id": "seed.dbt_bouncer_test_project.raw_payments", "compiled": null, "compiled_code": null, "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.338396Z", "completed_at": "2024-09-25T09:40:52.361326Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.372077Z", "completed_at": "2024-09-25T09:40:52.372101Z"}], "thread_id": "Thread-3", "execution_time": 0.052907705307006836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.metricflow_time_spine", "compiled": true, "compiled_code": "\n\n\nselect cast(range as date) as date_day\nfrom range(date '2009-01-01', date '2013-12-31', interval 1 day)", "relation_name": "\"dbt\".\"main\".\"metricflow_time_spine\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.356648Z", "completed_at": "2024-09-25T09:40:52.374366Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.390006Z", "completed_at": "2024-09-25T09:40:52.390032Z"}], "thread_id": "Thread-7", "execution_time": 0.06258082389831543, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.test_assert_something", "compiled": true, "compiled_code": "select * from (select 1 as id) where id > 1", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.392786Z", "completed_at": "2024-09-25T09:40:52.566899Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.600550Z", "completed_at": "2024-09-25T09:40:52.600585Z"}], "thread_id": "Thread-8", "execution_time": 0.23836112022399902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_disabled_model_id__name.9df33fe98e", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_disabled_model as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_disabled_model\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.473292Z", "completed_at": "2024-09-25T09:40:52.579402Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.604862Z", "completed_at": "2024-09-25T09:40:52.604882Z"}], "thread_id": "Thread-1", "execution_time": 0.22485828399658203, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.dbt_expectations_expect_compound_columns_to_be_unique_int_model_1_id__name.e40580bf12", "compiled": true, "compiled_code": "\n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation_errors as (\n\n select\n id,name,\n count(*) as \"n_records\"\n from __dbt__cte__int_model_1\n where\n 1=1\n and \n not (\n id is null and \n name is null\n \n )\n\n\n \n group by\n id,name\n having count(*) > 1\n\n)\nselect * from validation_errors\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.489032Z", "completed_at": "2024-09-25T09:40:52.596434Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.623381Z", "completed_at": "2024-09-25T09:40:52.623404Z"}], "thread_id": "Thread-2", "execution_time": 0.24121689796447754, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_int_model_1_id.da20a8abb3", "compiled": true, "compiled_code": "\n \n \n\n\n\nwith __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n) select id\nfrom __dbt__cte__int_model_1\nwhere id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.519446Z", "completed_at": "2024-09-25T09:40:52.598861Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.625705Z", "completed_at": "2024-09-25T09:40:52.625732Z"}], "thread_id": "Thread-4", "execution_time": 0.24016761779785156, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.values_below_threshold_int_model_1_id__10.f17ffbf65d", "compiled": true, "compiled_code": "\n\n with\n __dbt__cte__int_model_1 as (\n select 1 as id, 'Anna' as name\n), validation as (\n\n select count(*) as above_threshold_cnt\n\n from __dbt__cte__int_model_1\n where id > 10\n\n )\n\n select *\n from validation\n where above_threshold_cnt > 0\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.552599Z", "completed_at": "2024-09-25T09:40:52.602901Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.632155Z", "completed_at": "2024-09-25T09:40:52.632178Z"}], "thread_id": "Thread-5", "execution_time": 0.22918009757995605, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_customers", "compiled": true, "compiled_code": "with\n source as (\n select *\n from \"dbt\".\"main\".\"raw_customers\"\n\n union distinct\n\n select *\n from read_csv('./dbt_project/seeds/raw_customers.csv')\n\n ),\n\n renamed as (select id as customer_id, first_name, last_name from source)\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.569106Z", "completed_at": "2024-09-25T09:40:52.607257Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.636624Z", "completed_at": "2024-09-25T09:40:52.636645Z"}], "thread_id": "Thread-6", "execution_time": 0.19195890426635742, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_orders", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_orders\"\n\n ),\n\n renamed as (\n\n select id as order_id, user_id as customer_id, order_date, status from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.608966Z", "completed_at": "2024-09-25T09:40:52.621621Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.638967Z", "completed_at": "2024-09-25T09:40:52.638995Z"}], "thread_id": "Thread-7", "execution_time": 0.09150028228759766, "adapter_response": {}, "message": null, "failures": null, "unique_id": "snapshot.dbt_bouncer_test_project.orders_snapshot", "compiled": true, "compiled_code": "\n\n \n\n select *\n from \"dbt\".\"main\".\"raw_orders\"\n", "relation_name": "\"dbt\".\"dbt_pslattery\".\"orders_snapshot\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.581156Z", "completed_at": "2024-09-25T09:40:52.630172Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.644273Z", "completed_at": "2024-09-25T09:40:52.644293Z"}], "thread_id": "Thread-3", "execution_time": 0.18997883796691895, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.stg_payments", "compiled": true, "compiled_code": "with\n source as (\n select * from \"dbt\".\"main\".\"raw_payments\"\n\n ),\n\n renamed as (\n\n select\n id as payment_id,\n order_id,\n payment_method,\n\n -- `amount` is currently stored in cents, so we convert it to dollars\n (amount / 100) as amount\n\n from source\n\n )\n\nselect *\nfrom renamed", "relation_name": "\"dbt\".\"main\".\"stg_payments\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.670235Z", "completed_at": "2024-09-25T09:40:52.731995Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.936875Z", "completed_at": "2024-09-25T09:40:52.936903Z"}], "thread_id": "Thread-8", "execution_time": 0.29496192932128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_metricflow_time_spine_date_day.54acf49e8d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect date_day\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.686625Z", "completed_at": "2024-09-25T09:40:52.752932Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.945926Z", "completed_at": "2024-09-25T09:40:52.945964Z"}], "thread_id": "Thread-1", "execution_time": 0.2991015911102295, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_metricflow_time_spine_date_day.ddb41ceac8", "compiled": true, "compiled_code": "\n \n \n\nselect\n date_day as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"metricflow_time_spine\"\nwhere date_day is not null\ngroup by date_day\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.716420Z", "completed_at": "2024-09-25T09:40:52.944521Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.957037Z", "completed_at": "2024-09-25T09:40:52.957071Z"}], "thread_id": "Thread-2", "execution_time": 0.2941110134124756, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_customers_customer_id.e2cfb1f9aa", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.733682Z", "completed_at": "2024-09-25T09:40:52.948312Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.963548Z", "completed_at": "2024-09-25T09:40:52.963572Z"}], "thread_id": "Thread-4", "execution_time": 0.29725146293640137, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_customers_customer_id.c7614daada", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.743974Z", "completed_at": "2024-09-25T09:40:52.950505Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.966079Z", "completed_at": "2024-09-25T09:40:52.966100Z"}], "thread_id": "Thread-6", "execution_time": 0.2979297637939453, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.770183Z", "completed_at": "2024-09-25T09:40:52.952473Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.970129Z", "completed_at": "2024-09-25T09:40:52.970155Z"}], "thread_id": "Thread-5", "execution_time": 0.28965210914611816, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_orders_order_id.81cfe2fe64", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.787753Z", "completed_at": "2024-09-25T09:40:52.959783Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.976476Z", "completed_at": "2024-09-25T09:40:52.976502Z"}], "thread_id": "Thread-3", "execution_time": 0.2919943332672119, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_orders_order_id.e3b841c71a", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.809998Z", "completed_at": "2024-09-25T09:40:52.968407Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:52.982706Z", "completed_at": "2024-09-25T09:40:52.982731Z"}], "thread_id": "Thread-7", "execution_time": 0.2757999897003174, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.customers", "compiled": true, "compiled_code": "\n\nwith\n customers as (select * from \"dbt\".\"main\".\"stg_customers\"),\n\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n customer_orders as (\n\n select\n customer_id,\n\n min(order_date) as first_order_date,\n max(order_date) as most_recent_order_date,\n count(order_id) as number_of_orders\n from orders\n\n group by customer_id\n\n ),\n\n customer_payments as (\n\n select orders.customer_id, sum(amount) as total_amount\n\n from payments\n\n left join orders on payments.order_id = orders.order_id\n\n group by orders.customer_id\n\n ),\n\n final as (\n\n select\n customers.customer_id,\n customers.first_name,\n customers.last_name,\n customer_orders.first_order_date,\n customer_orders.most_recent_order_date,\n customer_orders.number_of_orders,\n if(\n customer_orders.number_of_orders > 5, true, false\n ) as is_recurring_customer,\n coalesce(customer_payments.total_amount, 0) as customer_lifetime_value\n\n from customers\n\n left join customer_orders on customers.customer_id = customer_orders.customer_id\n\n left join\n customer_payments on customers.customer_id = customer_payments.customer_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"customers\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:52.993969Z", "completed_at": "2024-09-25T09:40:53.063184Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.072861Z", "completed_at": "2024-09-25T09:40:53.072889Z"}], "thread_id": "Thread-8", "execution_time": 0.10062599182128906, "adapter_response": {}, "message": null, "failures": null, "unique_id": "model.dbt_bouncer_test_project.orders", "compiled": true, "compiled_code": "\n\nwith\n orders as (select * from \"dbt\".\"main\".\"stg_orders\"),\n\n payments as (select * from \"dbt\".\"main\".\"stg_payments\"),\n\n order_payments as (\n\n select\n order_id,\n\n sum(\n case\n when payment_method = 'credit_card' then amount else 0\n end\n ) as credit_card_amount,\n sum(\n case\n when payment_method = 'coupon' then amount else 0\n end\n ) as coupon_amount,\n sum(\n case\n when payment_method = 'bank_transfer' then amount else 0\n end\n ) as bank_transfer_amount,\n sum(\n case\n when payment_method = 'gift_card' then amount else 0\n end\n ) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n ),\n\n final as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n left join order_payments on orders.order_id = order_payments.order_id\n\n )\n\nselect *\nfrom final", "relation_name": "\"dbt\".\"main\".\"orders\""}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.009686Z", "completed_at": "2024-09-25T09:40:53.070489Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.091872Z", "completed_at": "2024-09-25T09:40:53.091900Z"}], "thread_id": "Thread-1", "execution_time": 0.11344552040100098, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.034968Z", "completed_at": "2024-09-25T09:40:53.075105Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.096163Z", "completed_at": "2024-09-25T09:40:53.096183Z"}], "thread_id": "Thread-2", "execution_time": 0.10906171798706055, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_stg_payments_payment_id.c19cc50075", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.042013Z", "completed_at": "2024-09-25T09:40:53.079994Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.121478Z", "completed_at": "2024-09-25T09:40:53.121502Z"}], "thread_id": "Thread-4", "execution_time": 0.13040757179260254, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_stg_payments_payment_id.3744510712", "compiled": true, "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.081419Z", "completed_at": "2024-09-25T09:40:53.136500Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.147343Z", "completed_at": "2024-09-25T09:40:53.147354Z"}], "thread_id": "Thread-6", "execution_time": 0.10726499557495117, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_customer_id.5c9bf9911d", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.100879Z", "completed_at": "2024-09-25T09:40:53.142499Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.150304Z", "completed_at": "2024-09-25T09:40:53.150313Z"}], "thread_id": "Thread-5", "execution_time": 0.08552908897399902, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_customers_is_recurring_customer.92b6f2f38b", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect is_recurring_customer\nfrom \"dbt\".\"main\".\"customers\"\nwhere is_recurring_customer is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.114580Z", "completed_at": "2024-09-25T09:40:53.144681Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.152646Z", "completed_at": "2024-09-25T09:40:53.152652Z"}], "thread_id": "Thread-3", "execution_time": 0.08582115173339844, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_customers_customer_id.c5af1ff4b1", "compiled": true, "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.154681Z", "completed_at": "2024-09-25T09:40:53.201762Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.227696Z", "completed_at": "2024-09-25T09:40:53.227721Z"}], "thread_id": "Thread-7", "execution_time": 0.09334564208984375, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "compiled": true, "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbt\".\"main\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.163679Z", "completed_at": "2024-09-25T09:40:53.218383Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.233457Z", "completed_at": "2024-09-25T09:40:53.233483Z"}], "thread_id": "Thread-8", "execution_time": 0.09576225280761719, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_amount.106140f9fd", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.170932Z", "completed_at": "2024-09-25T09:40:53.224633Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.248029Z", "completed_at": "2024-09-25T09:40:53.248052Z"}], "thread_id": "Thread-1", "execution_time": 0.10486555099487305, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_bank_transfer_amount.7743500c49", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.184963Z", "completed_at": "2024-09-25T09:40:53.226075Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.251650Z", "completed_at": "2024-09-25T09:40:53.251679Z"}], "thread_id": "Thread-2", "execution_time": 0.10661172866821289, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_coupon_amount.ab90c90625", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere coupon_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.203568Z", "completed_at": "2024-09-25T09:40:53.231965Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.267786Z", "completed_at": "2024-09-25T09:40:53.267811Z"}], "thread_id": "Thread-4", "execution_time": 0.1187896728515625, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_credit_card_amount.d3ca593b59", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere credit_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.237581Z", "completed_at": "2024-09-25T09:40:53.288160Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.293005Z", "completed_at": "2024-09-25T09:40:53.293019Z"}], "thread_id": "Thread-6", "execution_time": 0.09322285652160645, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_customer_id.c5f02694af", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere customer_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.255859Z", "completed_at": "2024-09-25T09:40:53.289215Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.294211Z", "completed_at": "2024-09-25T09:40:53.294224Z"}], "thread_id": "Thread-5", "execution_time": 0.08015036582946777, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_gift_card_amount.413a0d2d7a", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbt\".\"main\".\"orders\"\nwhere gift_card_amount is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.272183Z", "completed_at": "2024-09-25T09:40:53.290363Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.295448Z", "completed_at": "2024-09-25T09:40:53.295464Z"}], "thread_id": "Thread-3", "execution_time": 0.0755915641784668, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.not_null_orders_order_id.cf6c17daed", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is null\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.306499Z", "completed_at": "2024-09-25T09:40:53.312948Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.314357Z", "completed_at": "2024-09-25T09:40:53.314370Z"}], "thread_id": "Thread-8", "execution_time": 0.027913808822631836, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.unique_orders_order_id.fed79b3a6e", "compiled": true, "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbt\".\"main\".\"orders\"\nwhere order_id is not null\ngroup by order_id\nhaving count(*) > 1\n\n\n", "relation_name": null}, {"status": "success", "timing": [{"name": "compile", "started_at": "2024-09-25T09:40:53.297210Z", "completed_at": "2024-09-25T09:40:53.313575Z"}, {"name": "execute", "started_at": "2024-09-25T09:40:53.315424Z", "completed_at": "2024-09-25T09:40:53.315432Z"}], "thread_id": "Thread-7", "execution_time": 0.03112006187438965, "adapter_response": {}, "message": null, "failures": null, "unique_id": "test.dbt_bouncer_test_project.relationships_orders_customer_id__customer_id__ref_customers_.c6ec7f58f2", "compiled": true, "compiled_code": "\n \n \n\nwith child as (\n select customer_id as from_field\n from \"dbt\".\"main\".\"orders\"\n where customer_id is not null\n),\n\nparent as (\n select customer_id as to_field\n from \"dbt\".\"main\".\"customers\"\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n\n", "relation_name": null}], "elapsed_time": 1.22298264503479, "args": {"require_explicit_package_overrides_for_builtin_materializations": true, "partial_parse_file_diff": true, "log_format_file": "debug", "cache_selected_only": false, "macro_debugging": false, "vars": {}, "exclude": [], "use_colors": true, "source_freshness_run_project_hooks": false, "defer": false, "indirect_selection": "eager", "partial_parse": true, "printer_width": 80, "print": true, "select": [], "populate_cache": true, "enable_legacy_logger": false, "quiet": false, "send_anonymous_usage_stats": true, "warn_error_options": {"include": [], "exclude": []}, "target_path": "/home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target", "empty_catalog": false, "version_check": true, "show_resource_report": false, "which": "generate", "compile": true, "static": false, "log_file_max_bytes": 10485760, "project_dir": "dbt_project", "log_level": "info", "require_resource_names_without_spaces": false, "invocation_command": "dbt docs generate --project-dir dbt_project --profiles-dir dbt_project --target-path /home/pslattery/repos/dbt-bouncer/tests/fixtures/dbt_18/target", "static_parser": true, "log_level_file": "debug", "log_format": "default", "profiles_dir": "dbt_project", "use_colors_file": true, "favor_state": false, "strict_mode": false, "write_json": true, "log_path": "dbt_project/logs", "introspect": true}}